1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: AccessiblePreviewTable.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sc.hxx"
34 #include "scitems.hxx"
35 #include "AccessiblePreviewTable.hxx"
36 #include "AccessiblePreviewCell.hxx"
37 #include "AccessiblePreviewHeaderCell.hxx"
38 #include "AccessibilityHints.hxx"
39 #include "prevwsh.hxx"
40 #include "unoguard.hxx"
41 #include "miscuno.hxx"
42 #include "prevloc.hxx"
44 #include "document.hxx"
45 #include "scresid.hxx"
50 #include <com/sun/star/accessibility/AccessibleRole.hpp>
51 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
52 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
54 #include <vcl/window.hxx>
55 #include <svtools/smplhint.hxx>
56 #include <unotools/accessiblestatesethelper.hxx>
57 #include <comphelper/sequence.hxx>
59 using namespace ::com::sun::star
;
60 using namespace ::com::sun::star::accessibility
;
62 //===== internal ============================================================
64 ScAccessiblePreviewTable::ScAccessiblePreviewTable( const ::com::sun::star::uno::Reference
<
65 ::com::sun::star::accessibility::XAccessible
>& rxParent
,
66 ScPreviewShell
* pViewShell
, sal_Int32 nIndex
) :
67 ScAccessibleContextBase( rxParent
, AccessibleRole::TABLE
),
68 mpViewShell( pViewShell
),
73 mpViewShell
->AddAccessibilityObject(*this);
76 ScAccessiblePreviewTable::~ScAccessiblePreviewTable()
78 if (!ScAccessibleContextBase::IsDefunc() && !rBHelper
.bInDispose
)
80 // increment refcount to prevent double call off dtor
81 osl_incrementInterlockedCount( &m_refCount
);
86 void SAL_CALL
ScAccessiblePreviewTable::disposing()
91 mpViewShell
->RemoveAccessibilityObject(*this);
96 DELETEZ (mpTableInfo
);
98 ScAccessibleContextBase::disposing();
101 //===== SfxListener =====================================================
103 void ScAccessiblePreviewTable::Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
)
105 if (rHint
.ISA( SfxSimpleHint
))
107 const SfxSimpleHint
& rRef
= (const SfxSimpleHint
&)rHint
;
108 ULONG nId
= rRef
.GetId();
109 if ( nId
== SFX_HINT_DATACHANGED
)
111 // column / row layout may change with any document change,
112 // so it must be invalidated
113 DELETEZ( mpTableInfo
);
115 else if (rRef
.GetId() == SC_HINT_ACC_VISAREACHANGED
)
117 AccessibleEventObject aEvent
;
118 aEvent
.EventId
= AccessibleEventId::VISIBLE_DATA_CHANGED
;
119 aEvent
.Source
= uno::Reference
< XAccessibleContext
>(this);
120 CommitChange(aEvent
);
124 ScAccessibleContextBase::Notify(rBC
, rHint
);
127 //===== XInterface =====================================================
129 uno::Any SAL_CALL
ScAccessiblePreviewTable::queryInterface( uno::Type
const & rType
)
130 throw (uno::RuntimeException
)
132 uno::Any
aAny (ScAccessiblePreviewTableImpl::queryInterface(rType
));
133 return aAny
.hasValue() ? aAny
: ScAccessibleContextBase::queryInterface(rType
);
136 void SAL_CALL
ScAccessiblePreviewTable::acquire()
139 ScAccessibleContextBase::acquire();
142 void SAL_CALL
ScAccessiblePreviewTable::release()
145 ScAccessibleContextBase::release();
148 //===== XAccessibleTable ================================================
150 sal_Int32 SAL_CALL
ScAccessiblePreviewTable::getAccessibleRowCount() throw (uno::RuntimeException
)
159 nRet
= mpTableInfo
->GetRows();
163 sal_Int32 SAL_CALL
ScAccessiblePreviewTable::getAccessibleColumnCount() throw (uno::RuntimeException
)
172 nRet
= mpTableInfo
->GetCols();
176 rtl::OUString SAL_CALL
ScAccessiblePreviewTable::getAccessibleRowDescription( sal_Int32 nRow
)
177 throw (lang::IndexOutOfBoundsException
, uno::RuntimeException
)
179 // is not supported or specified so not implemented
180 /* ScUnoGuard aGuard;
186 if ( mpTableInfo && nRow >= 0 && nRow < mpTableInfo->GetRows() )
188 const ScPreviewColRowInfo& rInfo = mpTableInfo->GetRowInfo()[nRow];
189 if ( rInfo.bIsHeader )
191 //! name of column headers row?
193 sName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Column Headers"));
198 sName = rtl::OUString::valueOf( (sal_Int32) ( rInfo.nDocIndex + 1 ) );
202 throw lang::IndexOutOfBoundsException();*/
206 if ( nRow
< 0 || (mpTableInfo
&& nRow
>= mpTableInfo
->GetRows()) )
207 throw lang::IndexOutOfBoundsException();
209 return rtl::OUString();
212 rtl::OUString SAL_CALL
ScAccessiblePreviewTable::getAccessibleColumnDescription( sal_Int32 nColumn
)
213 throw (lang::IndexOutOfBoundsException
, uno::RuntimeException
)
215 // is not supported or specified so not implemented
216 /* ScUnoGuard aGuard;
222 if ( mpTableInfo && nColumn >= 0 && nColumn < mpTableInfo->GetCols() )
224 const ScPreviewColRowInfo& rInfo = mpTableInfo->GetColInfo()[nColumn];
225 if ( rInfo.bIsHeader )
227 //! name of row headers column?
229 sName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Row Headers"));
233 // normal column name
234 sName = ScColToAlpha( rInfo.nDocIndex );
238 throw lang::IndexOutOfBoundsException();*/
242 if ( nColumn
< 0 || (mpTableInfo
&& nColumn
>= mpTableInfo
->GetCols()) )
243 throw lang::IndexOutOfBoundsException();
245 return rtl::OUString();
248 sal_Int32 SAL_CALL
ScAccessiblePreviewTable::getAccessibleRowExtentAt( sal_Int32 nRow
, sal_Int32 nColumn
)
249 throw (lang::IndexOutOfBoundsException
, uno::RuntimeException
)
257 if ( mpViewShell
&& mpTableInfo
&& nColumn
>= 0 && nRow
>= 0 &&
258 nColumn
< mpTableInfo
->GetCols() && nRow
< mpTableInfo
->GetRows() )
260 const ScPreviewColRowInfo
& rColInfo
= mpTableInfo
->GetColInfo()[nColumn
];
261 const ScPreviewColRowInfo
& rRowInfo
= mpTableInfo
->GetRowInfo()[nRow
];
263 if ( rColInfo
.bIsHeader
|| rRowInfo
.bIsHeader
)
265 // header cells only span a single cell
269 ScDocument
* pDoc
= mpViewShell
->GetDocument();
270 const ScMergeAttr
* pItem
= (const ScMergeAttr
*)pDoc
->GetAttr(
271 static_cast<SCCOL
>(rColInfo
.nDocIndex
), static_cast<SCROW
>(rRowInfo
.nDocIndex
), mpTableInfo
->GetTab(), ATTR_MERGE
);
272 if ( pItem
&& pItem
->GetRowMerge() > 0 )
273 nRows
= pItem
->GetRowMerge();
277 throw lang::IndexOutOfBoundsException();
282 sal_Int32 SAL_CALL
ScAccessiblePreviewTable::getAccessibleColumnExtentAt( sal_Int32 nRow
, sal_Int32 nColumn
)
283 throw (lang::IndexOutOfBoundsException
, uno::RuntimeException
)
290 sal_Int32 nColumns
= 1;
291 if ( mpViewShell
&& mpTableInfo
&& nColumn
>= 0 && nRow
>= 0 &&
292 nColumn
< mpTableInfo
->GetCols() && nRow
< mpTableInfo
->GetRows() )
294 const ScPreviewColRowInfo
& rColInfo
= mpTableInfo
->GetColInfo()[nColumn
];
295 const ScPreviewColRowInfo
& rRowInfo
= mpTableInfo
->GetRowInfo()[nRow
];
297 if ( rColInfo
.bIsHeader
|| rRowInfo
.bIsHeader
)
299 // header cells only span a single cell
303 ScDocument
* pDoc
= mpViewShell
->GetDocument();
304 const ScMergeAttr
* pItem
= (const ScMergeAttr
*)pDoc
->GetAttr(
305 static_cast<SCCOL
>(rColInfo
.nDocIndex
), static_cast<SCROW
>(rRowInfo
.nDocIndex
), mpTableInfo
->GetTab(), ATTR_MERGE
);
306 if ( pItem
&& pItem
->GetColMerge() > 0 )
307 nColumns
= pItem
->GetColMerge();
311 throw lang::IndexOutOfBoundsException();
316 uno::Reference
< XAccessibleTable
> SAL_CALL
ScAccessiblePreviewTable::getAccessibleRowHeaders() throw (uno::RuntimeException
)
322 uno::Reference
< XAccessibleTable
> SAL_CALL
ScAccessiblePreviewTable::getAccessibleColumnHeaders() throw (uno::RuntimeException
)
328 uno::Sequence
< sal_Int32
> SAL_CALL
ScAccessiblePreviewTable::getSelectedAccessibleRows() throw (uno::RuntimeException
)
330 // in the page preview, there is no selection
331 return uno::Sequence
<sal_Int32
>(0);
334 uno::Sequence
< sal_Int32
> SAL_CALL
ScAccessiblePreviewTable::getSelectedAccessibleColumns() throw (uno::RuntimeException
)
336 // in the page preview, there is no selection
337 return uno::Sequence
<sal_Int32
>(0);
340 sal_Bool SAL_CALL
ScAccessiblePreviewTable::isAccessibleRowSelected( sal_Int32 nRow
)
341 throw (lang::IndexOutOfBoundsException
, uno::RuntimeException
)
343 // in the page preview, there is no selection
347 if ( nRow
< 0 || (mpTableInfo
&& nRow
>= mpTableInfo
->GetRows()) )
348 throw lang::IndexOutOfBoundsException();
353 sal_Bool SAL_CALL
ScAccessiblePreviewTable::isAccessibleColumnSelected( sal_Int32 nColumn
)
354 throw (lang::IndexOutOfBoundsException
, uno::RuntimeException
)
356 // in the page preview, there is no selection
360 if ( nColumn
< 0 || (mpTableInfo
&& nColumn
>= mpTableInfo
->GetCols()) )
361 throw lang::IndexOutOfBoundsException();
366 uno::Reference
< XAccessible
> SAL_CALL
ScAccessiblePreviewTable::getAccessibleCellAt( sal_Int32 nRow
, sal_Int32 nColumn
)
367 throw (lang::IndexOutOfBoundsException
, uno::RuntimeException
)
374 uno::Reference
<XAccessible
> xRet
;
375 if ( mpTableInfo
&& nColumn
>= 0 && nRow
>= 0 && nColumn
< mpTableInfo
->GetCols() && nRow
< mpTableInfo
->GetRows() )
377 // index iterates horizontally
378 long nNewIndex
= nRow
* mpTableInfo
->GetCols() + nColumn
;
380 const ScPreviewColRowInfo
& rColInfo
= mpTableInfo
->GetColInfo()[nColumn
];
381 const ScPreviewColRowInfo
& rRowInfo
= mpTableInfo
->GetRowInfo()[nRow
];
383 ScAddress
aCellPos( static_cast<SCCOL
>(rColInfo
.nDocIndex
), static_cast<SCROW
>(rRowInfo
.nDocIndex
), mpTableInfo
->GetTab() );
384 if ( rColInfo
.bIsHeader
|| rRowInfo
.bIsHeader
)
386 ScAccessiblePreviewHeaderCell
* pHeaderCell
= new ScAccessiblePreviewHeaderCell( this, mpViewShell
, aCellPos
,
387 rRowInfo
.bIsHeader
, rColInfo
.bIsHeader
, nNewIndex
);
393 ScAccessiblePreviewCell
* pCell
= new ScAccessiblePreviewCell( this, mpViewShell
, aCellPos
, nNewIndex
);
400 throw lang::IndexOutOfBoundsException();
405 uno::Reference
< XAccessible
> SAL_CALL
ScAccessiblePreviewTable::getAccessibleCaption() throw (uno::RuntimeException
)
411 uno::Reference
< XAccessible
> SAL_CALL
ScAccessiblePreviewTable::getAccessibleSummary() throw (uno::RuntimeException
)
417 sal_Bool SAL_CALL
ScAccessiblePreviewTable::isAccessibleSelected( sal_Int32 nRow
, sal_Int32 nColumn
)
418 throw (lang::IndexOutOfBoundsException
, uno::RuntimeException
)
420 // in the page preview, there is no selection
426 if ( mpTableInfo
&& nColumn
>= 0 && nRow
>= 0 && nColumn
< mpTableInfo
->GetCols() && nRow
< mpTableInfo
->GetRows() )
428 // index iterates horizontally
431 throw lang::IndexOutOfBoundsException();
436 sal_Int32 SAL_CALL
ScAccessiblePreviewTable::getAccessibleIndex( sal_Int32 nRow
, sal_Int32 nColumn
)
437 throw (lang::IndexOutOfBoundsException
, uno::RuntimeException
)
445 if ( mpTableInfo
&& nColumn
>= 0 && nRow
>= 0 && nColumn
< mpTableInfo
->GetCols() && nRow
< mpTableInfo
->GetRows() )
447 // index iterates horizontally
448 nRet
= nRow
* mpTableInfo
->GetCols() + nColumn
;
451 throw lang::IndexOutOfBoundsException();
456 sal_Int32 SAL_CALL
ScAccessiblePreviewTable::getAccessibleRow( sal_Int32 nChildIndex
)
457 throw (lang::IndexOutOfBoundsException
, uno::RuntimeException
)
465 if ( mpTableInfo
&& nChildIndex
>= 0 && nChildIndex
< static_cast<sal_Int32
>(mpTableInfo
->GetRows()) * mpTableInfo
->GetCols() )
467 nRow
= nChildIndex
/ mpTableInfo
->GetCols();
470 throw lang::IndexOutOfBoundsException();
475 sal_Int32 SAL_CALL
ScAccessiblePreviewTable::getAccessibleColumn( sal_Int32 nChildIndex
)
476 throw (lang::IndexOutOfBoundsException
, uno::RuntimeException
)
484 if ( mpTableInfo
&& nChildIndex
>= 0 && nChildIndex
< static_cast<sal_Int32
>(mpTableInfo
->GetRows()) * mpTableInfo
->GetCols() )
486 nCol
= nChildIndex
% static_cast<sal_Int32
>(mpTableInfo
->GetCols());
489 throw lang::IndexOutOfBoundsException();
494 //===== XAccessibleComponent ============================================
496 uno::Reference
< XAccessible
> SAL_CALL
ScAccessiblePreviewTable::getAccessibleAtPoint( const awt::Point
& aPoint
)
497 throw (uno::RuntimeException
)
499 uno::Reference
<XAccessible
> xRet
;
500 if (containsPoint(aPoint
))
509 SCCOL nCols
= mpTableInfo
->GetCols();
510 SCROW nRows
= mpTableInfo
->GetRows();
511 const ScPreviewColRowInfo
* pColInfo
= mpTableInfo
->GetColInfo();
512 const ScPreviewColRowInfo
* pRowInfo
= mpTableInfo
->GetRowInfo();
514 Rectangle
aScreenRect(GetBoundingBox());
516 awt::Point aMovedPoint
= aPoint
;
517 aMovedPoint
.X
+= aScreenRect
.Left();
518 aMovedPoint
.Y
+= aScreenRect
.Top();
520 if ( nCols
> 0 && nRows
> 0 && aMovedPoint
.X
>= pColInfo
[0].nPixelStart
&& aMovedPoint
.Y
>= pRowInfo
[0].nPixelStart
)
523 while ( nColIndex
< nCols
&& aMovedPoint
.X
> pColInfo
[nColIndex
].nPixelEnd
)
526 while ( nRowIndex
< nRows
&& aMovedPoint
.Y
> pRowInfo
[nRowIndex
].nPixelEnd
)
528 if ( nColIndex
< nCols
&& nRowIndex
< nRows
)
532 xRet
= getAccessibleCellAt( nRowIndex
, nColIndex
);
534 catch (uno::Exception
&)
545 void SAL_CALL
ScAccessiblePreviewTable::grabFocus() throw (uno::RuntimeException
)
549 if (getAccessibleParent().is())
551 uno::Reference
<XAccessibleComponent
> xAccessibleComponent(getAccessibleParent()->getAccessibleContext(), uno::UNO_QUERY
);
552 if (xAccessibleComponent
.is())
553 xAccessibleComponent
->grabFocus();
557 //===== XAccessibleContext ==============================================
559 sal_Int32 SAL_CALL
ScAccessiblePreviewTable::getAccessibleChildCount() throw (uno::RuntimeException
)
568 nRet
= static_cast<sal_Int32
>(mpTableInfo
->GetCols()) * mpTableInfo
->GetRows();
572 uno::Reference
< XAccessible
> SAL_CALL
ScAccessiblePreviewTable::getAccessibleChild( sal_Int32 nIndex
)
573 throw (lang::IndexOutOfBoundsException
, uno::RuntimeException
)
580 uno::Reference
<XAccessible
> xRet
;
583 long nColumns
= mpTableInfo
->GetCols();
586 // nCol, nRow are within the visible table, not the document
587 long nCol
= nIndex
% nColumns
;
588 long nRow
= nIndex
/ nColumns
;
590 xRet
= getAccessibleCellAt( nRow
, nCol
);
595 throw lang::IndexOutOfBoundsException();
600 sal_Int32 SAL_CALL
ScAccessiblePreviewTable::getAccessibleIndexInParent() throw (uno::RuntimeException
)
605 uno::Reference
< XAccessibleStateSet
> SAL_CALL
ScAccessiblePreviewTable::getAccessibleStateSet()
606 throw (uno::RuntimeException
)
609 uno::Reference
<XAccessibleStateSet
> xParentStates
;
610 if (getAccessibleParent().is())
612 uno::Reference
<XAccessibleContext
> xParentContext
= getAccessibleParent()->getAccessibleContext();
613 xParentStates
= xParentContext
->getAccessibleStateSet();
615 utl::AccessibleStateSetHelper
* pStateSet
= new utl::AccessibleStateSetHelper();
616 if (IsDefunc(xParentStates
))
617 pStateSet
->AddState(AccessibleStateType::DEFUNC
);
620 pStateSet
->AddState(AccessibleStateType::MANAGES_DESCENDANTS
);
621 pStateSet
->AddState(AccessibleStateType::ENABLED
);
622 pStateSet
->AddState(AccessibleStateType::OPAQUE
);
624 pStateSet
->AddState(AccessibleStateType::SHOWING
);
626 pStateSet
->AddState(AccessibleStateType::VISIBLE
);
631 //===== XServiceInfo ====================================================
633 rtl::OUString SAL_CALL
ScAccessiblePreviewTable::getImplementationName() throw(uno::RuntimeException
)
635 return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScAccessiblePreviewTable"));
638 uno::Sequence
<rtl::OUString
> SAL_CALL
ScAccessiblePreviewTable::getSupportedServiceNames()
639 throw(uno::RuntimeException
)
641 uno::Sequence
< ::rtl::OUString
> aSequence
= ScAccessibleContextBase::getSupportedServiceNames();
642 sal_Int32
nOldSize(aSequence
.getLength());
643 aSequence
.realloc(nOldSize
+ 1);
644 ::rtl::OUString
* pNames
= aSequence
.getArray();
646 pNames
[nOldSize
] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.table.AccessibleTableView"));
651 //===== XTypeProvider ===================================================
653 uno::Sequence
< uno::Type
> SAL_CALL
ScAccessiblePreviewTable::getTypes()
654 throw (uno::RuntimeException
)
656 return comphelper::concatSequences(ScAccessiblePreviewTableImpl::getTypes(), ScAccessibleContextBase::getTypes());
659 uno::Sequence
<sal_Int8
> SAL_CALL
ScAccessiblePreviewTable::getImplementationId()
660 throw(uno::RuntimeException
)
662 static uno::Sequence
< sal_Int8
> aId
;
663 if( aId
.getLength() == 0 )
666 rtl_createUuid (reinterpret_cast<sal_uInt8
*>(aId
.getArray()), 0, sal_True
);
671 //==== internal =========================================================
673 ::rtl::OUString SAL_CALL
ScAccessiblePreviewTable::createAccessibleDescription(void)
674 throw (uno::RuntimeException
)
676 String
sDesc(ScResId(STR_ACC_TABLE_DESCR
));
677 /* if (mpViewShell && mpViewShell->GetDocument())
684 if (mpViewShell->GetDocument()->GetName( mpTableInfo->GetTab(), sCoreName ))
685 sDesc.SearchAndReplaceAscii("%1", sCoreName);
688 sDesc.SearchAndReplaceAscii("%2", String(ScResId(SCSTR_UNKNOWN)));*/
689 return rtl::OUString(sDesc
);
692 ::rtl::OUString SAL_CALL
ScAccessiblePreviewTable::createAccessibleName(void)
693 throw (uno::RuntimeException
)
695 String
sName(ScResId(STR_ACC_TABLE_NAME
));
697 if (mpViewShell
&& mpViewShell
->GetDocument())
704 if (mpViewShell
->GetDocument()->GetName( mpTableInfo
->GetTab(), sCoreName
))
705 sName
.SearchAndReplaceAscii("%1", sCoreName
);
709 return rtl::OUString(sName
);
712 Rectangle
ScAccessiblePreviewTable::GetBoundingBoxOnScreen() const throw (uno::RuntimeException
)
714 Rectangle
aCellRect(GetBoundingBox());
717 Window
* pWindow
= mpViewShell
->GetWindow();
720 Rectangle aRect
= pWindow
->GetWindowExtentsRelative(NULL
);
721 aCellRect
.setX(aCellRect
.getX() + aRect
.getX());
722 aCellRect
.setY(aCellRect
.getY() + aRect
.getY());
728 Rectangle
ScAccessiblePreviewTable::GetBoundingBox() const throw (uno::RuntimeException
)
735 SCCOL nColumns
= mpTableInfo
->GetCols();
736 SCROW nRows
= mpTableInfo
->GetRows();
737 if ( nColumns
> 0 && nRows
> 0 )
739 const ScPreviewColRowInfo
* pColInfo
= mpTableInfo
->GetColInfo();
740 const ScPreviewColRowInfo
* pRowInfo
= mpTableInfo
->GetRowInfo();
742 aRect
= Rectangle( pColInfo
[0].nPixelStart
,
743 pRowInfo
[0].nPixelStart
,
744 pColInfo
[nColumns
-1].nPixelEnd
,
745 pRowInfo
[nRows
-1].nPixelEnd
);
751 sal_Bool
ScAccessiblePreviewTable::IsDefunc( const uno::Reference
<XAccessibleStateSet
>& rxParentStates
)
753 return ScAccessibleContextBase::IsDefunc() || (mpViewShell
== NULL
) || !getAccessibleParent().is() ||
754 (rxParentStates
.is() && rxParentStates
->contains(AccessibleStateType::DEFUNC
));
757 void ScAccessiblePreviewTable::FillTableInfo() const
759 if ( mpViewShell
&& !mpTableInfo
)
762 Window
* pWindow
= mpViewShell
->GetWindow();
764 aOutputSize
= pWindow
->GetOutputSizePixel();
766 Rectangle
aVisRect( aPoint
, aOutputSize
);
768 mpTableInfo
= new ScPreviewTableInfo
;
769 mpViewShell
->GetLocationData().GetTableInfo( aVisRect
, *mpTableInfo
);