1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <vcl/outdev.hxx>
22 #include "prevloc.hxx"
23 #include "document.hxx"
25 enum ScPreviewLocationType
38 struct ScPreviewLocationEntry
40 ScPreviewLocationType eType
;
46 ScPreviewLocationEntry( ScPreviewLocationType eNewType
, const Rectangle
& rPixel
, const ScRange
& rRange
,
47 bool bRepCol
, bool bRepRow
) :
51 bRepeatCol( bRepCol
),
57 ScPreviewTableInfo::ScPreviewTableInfo() :
66 ScPreviewTableInfo::~ScPreviewTableInfo()
72 void ScPreviewTableInfo::SetTab( SCTAB nNewTab
)
77 void ScPreviewTableInfo::SetColInfo( SCCOL nCount
, ScPreviewColRowInfo
* pNewInfo
)
84 void ScPreviewTableInfo::SetRowInfo( SCROW nCount
, ScPreviewColRowInfo
* pNewInfo
)
91 void ScPreviewTableInfo::LimitToArea( const Rectangle
& rPixelArea
)
95 // cells completely left of the visible area
97 while ( nStart
< nCols
&& pColInfo
[nStart
].nPixelEnd
< rPixelArea
.Left() )
100 // cells completely right of the visible area
102 while ( nEnd
> 0 && pColInfo
[nEnd
-1].nPixelStart
> rPixelArea
.Right() )
105 if ( nStart
> 0 || nEnd
< nCols
)
109 SCCOL nNewCount
= nEnd
- nStart
;
110 ScPreviewColRowInfo
* pNewInfo
= new ScPreviewColRowInfo
[nNewCount
];
111 for (SCCOL i
=0; i
<nNewCount
; i
++)
112 pNewInfo
[i
] = pColInfo
[nStart
+ i
];
113 SetColInfo( nNewCount
, pNewInfo
);
116 SetColInfo( 0, NULL
); // all invisible
122 // cells completely above the visible area
124 while ( nStart
< nRows
&& pRowInfo
[nStart
].nPixelEnd
< rPixelArea
.Top() )
127 // cells completely below the visible area
129 while ( nEnd
> 0 && pRowInfo
[nEnd
-1].nPixelStart
> rPixelArea
.Bottom() )
132 if ( nStart
> 0 || nEnd
< nRows
)
136 SCROW nNewCount
= nEnd
- nStart
;
137 ScPreviewColRowInfo
* pNewInfo
= new ScPreviewColRowInfo
[nNewCount
];
138 for (SCROW i
=0; i
<nNewCount
; i
++)
139 pNewInfo
[i
] = pRowInfo
[nStart
+ i
];
140 SetRowInfo( nNewCount
, pNewInfo
);
143 SetRowInfo( 0, NULL
); // all invisible
148 ScPreviewLocationData::ScPreviewLocationData( ScDocument
* pDocument
, OutputDevice
* pWin
) :
156 ScPreviewLocationData::~ScPreviewLocationData()
161 void ScPreviewLocationData::SetCellMapMode( const MapMode
& rMapMode
)
163 aCellMapMode
= rMapMode
;
166 void ScPreviewLocationData::SetPrintTab( SCTAB nNew
)
171 void ScPreviewLocationData::Clear()
178 void ScPreviewLocationData::AddCellRange( const Rectangle
& rRect
, const ScRange
& rRange
, bool bRepCol
, bool bRepRow
,
179 const MapMode
& rDrawMap
)
181 Rectangle
aPixelRect( pWindow
->LogicToPixel( rRect
) );
182 aEntries
.push_front( new ScPreviewLocationEntry( SC_PLOC_CELLRANGE
, aPixelRect
, rRange
, bRepCol
, bRepRow
) );
184 OSL_ENSURE( nDrawRanges
< SC_PREVIEW_MAXRANGES
, "too many ranges" );
186 if ( nDrawRanges
< SC_PREVIEW_MAXRANGES
)
188 aDrawRectangle
[nDrawRanges
] = aPixelRect
;
189 aDrawMapMode
[nDrawRanges
] = rDrawMap
;
194 aDrawRangeId
[nDrawRanges
] = SC_PREVIEW_RANGE_EDGE
;
196 aDrawRangeId
[nDrawRanges
] = SC_PREVIEW_RANGE_REPCOL
;
201 aDrawRangeId
[nDrawRanges
] = SC_PREVIEW_RANGE_REPROW
;
203 aDrawRangeId
[nDrawRanges
] = SC_PREVIEW_RANGE_TAB
;
210 void ScPreviewLocationData::AddColHeaders( const Rectangle
& rRect
, SCCOL nStartCol
, SCCOL nEndCol
, bool bRepCol
)
212 SCTAB nTab
= 0; //! ?
213 ScRange
aRange( nStartCol
, 0, nTab
, nEndCol
, 0, nTab
);
214 Rectangle
aPixelRect( pWindow
->LogicToPixel( rRect
) );
216 aEntries
.push_front( new ScPreviewLocationEntry( SC_PLOC_COLHEADER
, aPixelRect
, aRange
, bRepCol
, false ) );
219 void ScPreviewLocationData::AddRowHeaders( const Rectangle
& rRect
, SCROW nStartRow
, SCROW nEndRow
, bool bRepRow
)
221 SCTAB nTab
= 0; //! ?
222 ScRange
aRange( 0, nStartRow
, nTab
, 0, nEndRow
, nTab
);
223 Rectangle
aPixelRect( pWindow
->LogicToPixel( rRect
) );
225 aEntries
.push_front( new ScPreviewLocationEntry( SC_PLOC_ROWHEADER
, aPixelRect
, aRange
, false, bRepRow
) );
228 void ScPreviewLocationData::AddHeaderFooter( const Rectangle
& rRect
, bool bHeader
, bool bLeft
)
230 ScRange aRange
; //! ?
231 Rectangle
aPixelRect( pWindow
->LogicToPixel( rRect
) );
233 ScPreviewLocationType eType
= bHeader
?
234 ( bLeft
? SC_PLOC_LEFTHEADER
: SC_PLOC_RIGHTHEADER
) :
235 ( bLeft
? SC_PLOC_LEFTFOOTER
: SC_PLOC_RIGHTFOOTER
);
237 aEntries
.push_front( new ScPreviewLocationEntry( eType
, aPixelRect
, aRange
, false, false ) );
240 void ScPreviewLocationData::AddNoteMark( const Rectangle
& rRect
, const ScAddress
& rPos
)
242 ScRange
aRange( rPos
);
243 Rectangle
aPixelRect( pWindow
->LogicToPixel( rRect
) );
245 aEntries
.push_front( new ScPreviewLocationEntry( SC_PLOC_NOTEMARK
, aPixelRect
, aRange
, false, false ) );
248 void ScPreviewLocationData::AddNoteText( const Rectangle
& rRect
, const ScAddress
& rPos
)
250 ScRange
aRange( rPos
);
251 Rectangle
aPixelRect( pWindow
->LogicToPixel( rRect
) );
253 aEntries
.push_front( new ScPreviewLocationEntry( SC_PLOC_NOTETEXT
, aPixelRect
, aRange
, false, false ) );
256 void ScPreviewLocationData::GetDrawRange( sal_uInt16 nPos
, Rectangle
& rPixelRect
, MapMode
& rMapMode
, sal_uInt8
& rRangeId
) const
258 OSL_ENSURE( nPos
< nDrawRanges
, "wrong position" );
259 if ( nPos
< nDrawRanges
)
261 rPixelRect
= aDrawRectangle
[nPos
];
262 rMapMode
= aDrawMapMode
[nPos
];
263 rRangeId
= aDrawRangeId
[nPos
];
267 static ScPreviewLocationEntry
* lcl_GetEntryByAddress( const boost::ptr_list
<ScPreviewLocationEntry
> &rEntries
,
268 const ScAddress
& rPos
, ScPreviewLocationType eType
)
270 boost::ptr_list
<ScPreviewLocationEntry
>::const_iterator it
;
271 for (it
= rEntries
.begin(); it
!= rEntries
.end(); ++it
)
273 if ( it
->eType
== eType
&& it
->aCellRange
.In( rPos
) )
274 return const_cast<ScPreviewLocationEntry
*>(&(*it
));
280 Rectangle
ScPreviewLocationData::GetOffsetPixel( const ScAddress
& rCellPos
, const ScRange
& rRange
) const
282 const double nScaleX
= HMM_PER_TWIPS
;
283 const double nScaleY
= HMM_PER_TWIPS
;
284 SCTAB nTab
= rRange
.aStart
.Tab();
287 SCCOL nEndCol
= rCellPos
.Col();
288 for (SCCOL nCol
= rRange
.aStart
.Col(); nCol
< nEndCol
; nCol
++)
290 sal_uInt16 nDocW
= pDoc
->GetColWidth( nCol
, nTab
);
292 nPosX
+= (long) (nDocW
* nScaleX
);
294 long nSizeX
= (long) ( pDoc
->GetColWidth( nEndCol
, nTab
) * nScaleX
);
296 SCROW nEndRow
= rCellPos
.Row();
297 long nPosY
= (long) pDoc
->GetScaledRowHeight( rRange
.aStart
.Row(),
298 nEndRow
, nTab
, nScaleY
);
299 long nSizeY
= (long) ( pDoc
->GetRowHeight( nEndRow
, nTab
) * nScaleY
);
301 Size
aOffsetLogic( nPosX
, nPosY
);
302 Size
aSizeLogic( nSizeX
, nSizeY
);
303 Size aOffsetPixel
= pWindow
->LogicToPixel( aOffsetLogic
, aCellMapMode
);
304 Size aSizePixel
= pWindow
->LogicToPixel( aSizeLogic
, aCellMapMode
);
306 return Rectangle( Point( aOffsetPixel
.Width(), aOffsetPixel
.Height() ), aSizePixel
);
309 bool ScPreviewLocationData::GetCellPosition( const ScAddress
& rCellPos
, Rectangle
& rCellRect
) const
311 ScPreviewLocationEntry
* pEntry
= lcl_GetEntryByAddress( aEntries
, rCellPos
, SC_PLOC_CELLRANGE
);
314 Rectangle aOffsetRect
= GetOffsetPixel( rCellPos
, pEntry
->aCellRange
);
315 rCellRect
= Rectangle( aOffsetRect
.Left() + pEntry
->aPixelRect
.Left(),
316 aOffsetRect
.Top() + pEntry
->aPixelRect
.Top(),
317 aOffsetRect
.Right() + pEntry
->aPixelRect
.Left(),
318 aOffsetRect
.Bottom() + pEntry
->aPixelRect
.Top() );
324 bool ScPreviewLocationData::HasCellsInRange( const Rectangle
& rVisiblePixel
) const
326 boost::ptr_list
<ScPreviewLocationEntry
>::const_iterator it
;
327 for (it
= aEntries
.begin(); it
!= aEntries
.end(); ++it
)
329 if ( it
->eType
== SC_PLOC_CELLRANGE
|| it
->eType
== SC_PLOC_COLHEADER
|| it
->eType
== SC_PLOC_ROWHEADER
)
330 if ( it
->aPixelRect
.IsOver( rVisiblePixel
) )
337 bool ScPreviewLocationData::GetHeaderPosition( Rectangle
& rRect
) const
339 boost::ptr_list
<ScPreviewLocationEntry
>::const_iterator it
;
340 for (it
= aEntries
.begin(); it
!= aEntries
.end(); ++it
)
342 if ( it
->eType
== SC_PLOC_LEFTHEADER
|| it
->eType
== SC_PLOC_RIGHTHEADER
)
344 rRect
= it
->aPixelRect
;
352 bool ScPreviewLocationData::GetFooterPosition( Rectangle
& rRect
) const
354 boost::ptr_list
<ScPreviewLocationEntry
>::const_iterator it
;
355 for (it
= aEntries
.begin(); it
!= aEntries
.end(); ++it
)
357 if ( it
->eType
== SC_PLOC_LEFTFOOTER
|| it
->eType
== SC_PLOC_RIGHTFOOTER
)
359 rRect
= it
->aPixelRect
;
367 bool ScPreviewLocationData::IsHeaderLeft() const
369 boost::ptr_list
<ScPreviewLocationEntry
>::const_iterator it
;
370 for (it
= aEntries
.begin(); it
!= aEntries
.end(); ++it
)
372 if ( it
->eType
== SC_PLOC_LEFTHEADER
)
375 if ( it
->eType
== SC_PLOC_RIGHTHEADER
)
382 bool ScPreviewLocationData::IsFooterLeft() const
384 boost::ptr_list
<ScPreviewLocationEntry
>::const_iterator it
;
385 for (it
= aEntries
.begin(); it
!= aEntries
.end(); ++it
)
387 if ( it
->eType
== SC_PLOC_LEFTFOOTER
)
390 if ( it
->eType
== SC_PLOC_RIGHTFOOTER
)
397 long ScPreviewLocationData::GetNoteCountInRange( const Rectangle
& rVisiblePixel
, bool bNoteMarks
) const
399 ScPreviewLocationType eType
= bNoteMarks
? SC_PLOC_NOTEMARK
: SC_PLOC_NOTETEXT
;
402 boost::ptr_list
<ScPreviewLocationEntry
>::const_iterator it
;
403 for (it
= aEntries
.begin(); it
!= aEntries
.end(); ++it
)
405 if ( it
->eType
== eType
&& it
->aPixelRect
.IsOver( rVisiblePixel
) )
412 bool ScPreviewLocationData::GetNoteInRange( const Rectangle
& rVisiblePixel
, long nIndex
, bool bNoteMarks
,
413 ScAddress
& rCellPos
, Rectangle
& rNoteRect
) const
415 ScPreviewLocationType eType
= bNoteMarks
? SC_PLOC_NOTEMARK
: SC_PLOC_NOTETEXT
;
418 boost::ptr_list
<ScPreviewLocationEntry
>::const_iterator it
;
419 for (it
= aEntries
.begin(); it
!= aEntries
.end(); ++it
)
421 if ( it
->eType
== eType
&& it
->aPixelRect
.IsOver( rVisiblePixel
) )
423 if ( nPos
== sal::static_int_cast
<sal_uLong
>(nIndex
) )
425 rCellPos
= it
->aCellRange
.aStart
;
426 rNoteRect
= it
->aPixelRect
;
436 Rectangle
ScPreviewLocationData::GetNoteInRangeOutputRect(const Rectangle
& rVisiblePixel
, bool bNoteMarks
, const ScAddress
& aCellPos
) const
438 ScPreviewLocationType eType
= bNoteMarks
? SC_PLOC_NOTEMARK
: SC_PLOC_NOTETEXT
;
441 boost::ptr_list
<ScPreviewLocationEntry
>::const_iterator it
;
442 for (it
= aEntries
.begin(); it
!= aEntries
.end(); ++it
)
444 if ( it
->eType
== eType
&& it
->aPixelRect
.IsOver( rVisiblePixel
) )
446 if ( aCellPos
== it
->aCellRange
.aStart
)
447 return it
->aPixelRect
;
455 void ScPreviewLocationData::GetTableInfo( const Rectangle
& rVisiblePixel
, ScPreviewTableInfo
& rInfo
) const
457 const double nScaleX
= HMM_PER_TWIPS
;
458 const double nScaleY
= HMM_PER_TWIPS
;
460 // from left to right:
461 bool bHasHeaderCol
= false;
462 bool bHasRepCols
= false;
463 bool bHasMainCols
= false;
464 SCCOL nRepeatColStart
= 0;
465 SCCOL nRepeatColEnd
= 0;
466 SCCOL nMainColStart
= 0;
467 SCCOL nMainColEnd
= 0;
469 // from top to bottom:
470 bool bHasHeaderRow
= false;
471 bool bHasRepRows
= false;
472 bool bHasMainRows
= false;
473 SCROW nRepeatRowStart
= 0;
474 SCROW nRepeatRowEnd
= 0;
475 SCROW nMainRowStart
= 0;
476 SCROW nMainRowEnd
= 0;
478 Rectangle aHeaderRect
, aRepeatRect
, aMainRect
;
481 boost::ptr_list
<ScPreviewLocationEntry
>::const_iterator it
;
482 for (it
= aEntries
.begin(); it
!= aEntries
.end(); ++it
)
484 if ( it
->eType
== SC_PLOC_CELLRANGE
)
486 if ( it
->bRepeatCol
)
489 nRepeatColStart
= it
->aCellRange
.aStart
.Col();
490 nRepeatColEnd
= it
->aCellRange
.aEnd
.Col();
491 aRepeatRect
.Left() = it
->aPixelRect
.Left();
492 aRepeatRect
.Right() = it
->aPixelRect
.Right();
497 nMainColStart
= it
->aCellRange
.aStart
.Col();
498 nMainColEnd
= it
->aCellRange
.aEnd
.Col();
499 aMainRect
.Left() = it
->aPixelRect
.Left();
500 aMainRect
.Right() = it
->aPixelRect
.Right();
502 if ( it
->bRepeatRow
)
505 nRepeatRowStart
= it
->aCellRange
.aStart
.Row();
506 nRepeatRowEnd
= it
->aCellRange
.aEnd
.Row();
507 aRepeatRect
.Top() = it
->aPixelRect
.Top();
508 aRepeatRect
.Bottom() = it
->aPixelRect
.Bottom();
513 nMainRowStart
= it
->aCellRange
.aStart
.Row();
514 nMainRowEnd
= it
->aCellRange
.aEnd
.Row();
515 aMainRect
.Top() = it
->aPixelRect
.Top();
516 aMainRect
.Bottom() = it
->aPixelRect
.Bottom();
518 nTab
= it
->aCellRange
.aStart
.Tab(); //! store separately?
520 else if ( it
->eType
== SC_PLOC_ROWHEADER
)
522 // row headers result in an additional column
523 bHasHeaderCol
= true;
524 aHeaderRect
.Left() = it
->aPixelRect
.Left();
525 aHeaderRect
.Right() = it
->aPixelRect
.Right();
527 else if ( it
->eType
== SC_PLOC_COLHEADER
)
529 // column headers result in an additional row
530 bHasHeaderRow
= true;
531 aHeaderRect
.Top() = it
->aPixelRect
.Top();
532 aHeaderRect
.Bottom() = it
->aPixelRect
.Bottom();
543 for ( nCol
=nRepeatColStart
; nCol
<=nRepeatColEnd
; nCol
++ )
544 if (!pDoc
->ColHidden(nCol
, nTab
))
547 for ( nCol
=nMainColStart
; nCol
<=nMainColEnd
; nCol
++ )
548 if (!pDoc
->ColHidden(nCol
, nTab
))
553 ScPreviewColRowInfo
* pColInfo
= new ScPreviewColRowInfo
[ nColCount
];
558 pColInfo
[nColPos
].Set( true, 0, aHeaderRect
.Left(), aHeaderRect
.Right() );
564 for ( nCol
=nRepeatColStart
; nCol
<=nRepeatColEnd
; nCol
++ )
565 if (!pDoc
->ColHidden(nCol
, nTab
))
567 sal_uInt16 nDocW
= pDoc
->GetColWidth( nCol
, nTab
);
568 long nNextX
= nPosX
+ (long) (nDocW
* nScaleX
);
570 long nPixelStart
= pWindow
->LogicToPixel( Size( nPosX
, 0 ), aCellMapMode
).Width();
571 long nPixelEnd
= pWindow
->LogicToPixel( Size( nNextX
, 0 ), aCellMapMode
).Width() - 1;
572 pColInfo
[nColPos
].Set( false, nCol
,
573 aRepeatRect
.Left() + nPixelStart
,
574 aRepeatRect
.Left() + nPixelEnd
);
583 for ( nCol
=nMainColStart
; nCol
<=nMainColEnd
; nCol
++ )
584 if (!pDoc
->ColHidden(nCol
, nTab
))
586 sal_uInt16 nDocW
= pDoc
->GetColWidth( nCol
, nTab
);
587 long nNextX
= nPosX
+ (long) (nDocW
* nScaleX
);
589 long nPixelStart
= pWindow
->LogicToPixel( Size( nPosX
, 0 ), aCellMapMode
).Width();
590 long nPixelEnd
= pWindow
->LogicToPixel( Size( nNextX
, 0 ), aCellMapMode
).Width() - 1;
591 pColInfo
[nColPos
].Set( false, nCol
,
592 aMainRect
.Left() + nPixelStart
,
593 aMainRect
.Left() + nPixelEnd
);
599 rInfo
.SetColInfo( nColCount
, pColInfo
);
602 rInfo
.SetColInfo( 0, NULL
);
610 nRowCount
+= pDoc
->CountVisibleRows(nRepeatRowStart
, nRepeatRowEnd
, nTab
);
612 nRowCount
+= pDoc
->CountVisibleRows(nMainRowStart
, nMainRowEnd
, nTab
);
616 ScPreviewColRowInfo
* pRowInfo
= new ScPreviewColRowInfo
[ nRowCount
];
621 pRowInfo
[nRowPos
].Set( true, 0, aHeaderRect
.Top(), aHeaderRect
.Bottom() );
627 for (SCROW nRow
= nRepeatRowStart
; nRow
<= nRepeatRowEnd
; ++nRow
)
629 if (pDoc
->RowHidden(nRow
, nTab
))
632 sal_uInt16 nDocH
= pDoc
->GetOriginalHeight( nRow
, nTab
);
633 long nNextY
= nPosY
+ (long) (nDocH
* nScaleY
);
635 long nPixelStart
= pWindow
->LogicToPixel( Size( 0, nPosY
), aCellMapMode
).Height();
636 long nPixelEnd
= pWindow
->LogicToPixel( Size( 0, nNextY
), aCellMapMode
).Height() - 1;
637 pRowInfo
[nRowPos
].Set( false, nRow
,
638 aRepeatRect
.Top() + nPixelStart
,
639 aRepeatRect
.Top() + nPixelEnd
);
648 for (SCROW nRow
= nMainRowStart
; nRow
<= nMainRowEnd
; ++nRow
)
650 if (pDoc
->RowHidden(nRow
, nTab
))
653 sal_uInt16 nDocH
= pDoc
->GetOriginalHeight( nRow
, nTab
);
654 long nNextY
= nPosY
+ (long) (nDocH
* nScaleY
);
656 long nPixelStart
= pWindow
->LogicToPixel( Size( 0, nPosY
), aCellMapMode
).Height();
657 long nPixelEnd
= pWindow
->LogicToPixel( Size( 0, nNextY
), aCellMapMode
).Height() - 1;
658 pRowInfo
[nRowPos
].Set( false, nRow
,
659 aMainRect
.Top() + nPixelStart
,
660 aMainRect
.Top() + nPixelEnd
);
666 rInfo
.SetRowInfo( nRowCount
, pRowInfo
);
669 rInfo
.SetRowInfo( 0, NULL
);
671 // limit to visible area
673 rInfo
.SetTab( nTab
);
674 rInfo
.LimitToArea( rVisiblePixel
);
677 Rectangle
ScPreviewLocationData::GetHeaderCellOutputRect(const Rectangle
& rVisRect
, const ScAddress
& rCellPos
, bool bColHeader
) const
679 // first a stupid implementation
680 // NN says here should be done more
682 ScPreviewTableInfo aTableInfo
;
683 GetTableInfo( rVisRect
, aTableInfo
);
685 if ( (rCellPos
.Col() >= 0) &&
686 (rCellPos
.Row() >= 0) && (rCellPos
.Col() < aTableInfo
.GetCols()) &&
687 (rCellPos
.Row() < aTableInfo
.GetRows()) )
692 nCol
= rCellPos
.Col();
694 nRow
= rCellPos
.Row();
695 const ScPreviewColRowInfo
& rColInfo
= aTableInfo
.GetColInfo()[nCol
];
696 const ScPreviewColRowInfo
& rRowInfo
= aTableInfo
.GetRowInfo()[nRow
];
698 if ( rColInfo
.bIsHeader
|| rRowInfo
.bIsHeader
)
699 aClipRect
= Rectangle( rColInfo
.nPixelStart
, rRowInfo
.nPixelStart
, rColInfo
.nPixelEnd
, rRowInfo
.nPixelEnd
);
704 Rectangle
ScPreviewLocationData::GetCellOutputRect(const ScAddress
& rCellPos
) const
706 // first a stupid implementation
707 // NN says here should be done more
709 GetCellPosition(rCellPos
, aRect
);
713 // GetMainCellRange is used for links in PDF export
715 bool ScPreviewLocationData::GetMainCellRange( ScRange
& rRange
, Rectangle
& rPixRect
) const
717 boost::ptr_list
<ScPreviewLocationEntry
>::const_iterator it
;
718 for (it
= aEntries
.begin(); it
!= aEntries
.end(); ++it
)
720 if ( it
->eType
== SC_PLOC_CELLRANGE
&& !it
->bRepeatCol
&& !it
->bRepeatRow
)
722 rRange
= it
->aCellRange
;
723 rPixRect
= it
->aPixelRect
;
731 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */