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 .
21 #include <vcl/outdev.hxx>
23 #include "prevloc.hxx"
24 #include "document.hxx"
26 enum ScPreviewLocationType
39 struct ScPreviewLocationEntry
41 ScPreviewLocationType eType
;
47 ScPreviewLocationEntry( ScPreviewLocationType eNewType
, const Rectangle
& rPixel
, const ScRange
& rRange
,
48 sal_Bool bRepCol
, sal_Bool bRepRow
) :
52 bRepeatCol( bRepCol
),
58 ScPreviewTableInfo::ScPreviewTableInfo() :
67 ScPreviewTableInfo::~ScPreviewTableInfo()
73 void ScPreviewTableInfo::SetTab( SCTAB nNewTab
)
78 void ScPreviewTableInfo::SetColInfo( SCCOL nCount
, ScPreviewColRowInfo
* pNewInfo
)
85 void ScPreviewTableInfo::SetRowInfo( SCROW nCount
, ScPreviewColRowInfo
* pNewInfo
)
92 void ScPreviewTableInfo::LimitToArea( const Rectangle
& rPixelArea
)
96 // cells completely left of the visible area
98 while ( nStart
< nCols
&& pColInfo
[nStart
].nPixelEnd
< rPixelArea
.Left() )
101 // cells completely right of the visible area
103 while ( nEnd
> 0 && pColInfo
[nEnd
-1].nPixelStart
> rPixelArea
.Right() )
106 if ( nStart
> 0 || nEnd
< nCols
)
110 SCCOL nNewCount
= nEnd
- nStart
;
111 ScPreviewColRowInfo
* pNewInfo
= new ScPreviewColRowInfo
[nNewCount
];
112 for (SCCOL i
=0; i
<nNewCount
; i
++)
113 pNewInfo
[i
] = pColInfo
[nStart
+ i
];
114 SetColInfo( nNewCount
, pNewInfo
);
117 SetColInfo( 0, NULL
); // all invisible
123 // cells completely above the visible area
125 while ( nStart
< nRows
&& pRowInfo
[nStart
].nPixelEnd
< rPixelArea
.Top() )
128 // cells completely below the visible area
130 while ( nEnd
> 0 && pRowInfo
[nEnd
-1].nPixelStart
> rPixelArea
.Bottom() )
133 if ( nStart
> 0 || nEnd
< nRows
)
137 SCROW nNewCount
= nEnd
- nStart
;
138 ScPreviewColRowInfo
* pNewInfo
= new ScPreviewColRowInfo
[nNewCount
];
139 for (SCROW i
=0; i
<nNewCount
; i
++)
140 pNewInfo
[i
] = pRowInfo
[nStart
+ i
];
141 SetRowInfo( nNewCount
, pNewInfo
);
144 SetRowInfo( 0, NULL
); // all invisible
149 ScPreviewLocationData::ScPreviewLocationData( ScDocument
* pDocument
, OutputDevice
* pWin
) :
157 ScPreviewLocationData::~ScPreviewLocationData()
162 void ScPreviewLocationData::SetCellMapMode( const MapMode
& rMapMode
)
164 aCellMapMode
= rMapMode
;
167 void ScPreviewLocationData::SetPrintTab( SCTAB nNew
)
172 void ScPreviewLocationData::Clear()
179 void ScPreviewLocationData::AddCellRange( const Rectangle
& rRect
, const ScRange
& rRange
, sal_Bool bRepCol
, sal_Bool bRepRow
,
180 const MapMode
& rDrawMap
)
182 Rectangle
aPixelRect( pWindow
->LogicToPixel( rRect
) );
183 aEntries
.push_front( new ScPreviewLocationEntry( SC_PLOC_CELLRANGE
, aPixelRect
, rRange
, bRepCol
, bRepRow
) );
185 OSL_ENSURE( nDrawRanges
< SC_PREVIEW_MAXRANGES
, "too many ranges" );
187 if ( nDrawRanges
< SC_PREVIEW_MAXRANGES
)
189 aDrawRectangle
[nDrawRanges
] = aPixelRect
;
190 aDrawMapMode
[nDrawRanges
] = rDrawMap
;
195 aDrawRangeId
[nDrawRanges
] = SC_PREVIEW_RANGE_EDGE
;
197 aDrawRangeId
[nDrawRanges
] = SC_PREVIEW_RANGE_REPCOL
;
202 aDrawRangeId
[nDrawRanges
] = SC_PREVIEW_RANGE_REPROW
;
204 aDrawRangeId
[nDrawRanges
] = SC_PREVIEW_RANGE_TAB
;
211 void ScPreviewLocationData::AddColHeaders( const Rectangle
& rRect
, SCCOL nStartCol
, SCCOL nEndCol
, sal_Bool bRepCol
)
213 SCTAB nTab
= 0; //! ?
214 ScRange
aRange( nStartCol
, 0, nTab
, nEndCol
, 0, nTab
);
215 Rectangle
aPixelRect( pWindow
->LogicToPixel( rRect
) );
217 aEntries
.push_front( new ScPreviewLocationEntry( SC_PLOC_COLHEADER
, aPixelRect
, aRange
, bRepCol
, false ) );
220 void ScPreviewLocationData::AddRowHeaders( const Rectangle
& rRect
, SCROW nStartRow
, SCROW nEndRow
, sal_Bool bRepRow
)
222 SCTAB nTab
= 0; //! ?
223 ScRange
aRange( 0, nStartRow
, nTab
, 0, nEndRow
, nTab
);
224 Rectangle
aPixelRect( pWindow
->LogicToPixel( rRect
) );
226 aEntries
.push_front( new ScPreviewLocationEntry( SC_PLOC_ROWHEADER
, aPixelRect
, aRange
, false, bRepRow
) );
229 void ScPreviewLocationData::AddHeaderFooter( const Rectangle
& rRect
, sal_Bool bHeader
, sal_Bool bLeft
)
231 ScRange aRange
; //! ?
232 Rectangle
aPixelRect( pWindow
->LogicToPixel( rRect
) );
234 ScPreviewLocationType eType
= bHeader
?
235 ( bLeft
? SC_PLOC_LEFTHEADER
: SC_PLOC_RIGHTHEADER
) :
236 ( bLeft
? SC_PLOC_LEFTFOOTER
: SC_PLOC_RIGHTFOOTER
);
238 aEntries
.push_front( new ScPreviewLocationEntry( eType
, aPixelRect
, aRange
, false, false ) );
241 void ScPreviewLocationData::AddNoteMark( const Rectangle
& rRect
, const ScAddress
& rPos
)
243 ScRange
aRange( rPos
);
244 Rectangle
aPixelRect( pWindow
->LogicToPixel( rRect
) );
246 aEntries
.push_front( new ScPreviewLocationEntry( SC_PLOC_NOTEMARK
, aPixelRect
, aRange
, false, false ) );
249 void ScPreviewLocationData::AddNoteText( const Rectangle
& rRect
, const ScAddress
& rPos
)
251 ScRange
aRange( rPos
);
252 Rectangle
aPixelRect( pWindow
->LogicToPixel( rRect
) );
254 aEntries
.push_front( new ScPreviewLocationEntry( SC_PLOC_NOTETEXT
, aPixelRect
, aRange
, false, false ) );
257 void ScPreviewLocationData::GetDrawRange( sal_uInt16 nPos
, Rectangle
& rPixelRect
, MapMode
& rMapMode
, sal_uInt8
& rRangeId
) const
259 OSL_ENSURE( nPos
< nDrawRanges
, "wrong position" );
260 if ( nPos
< nDrawRanges
)
262 rPixelRect
= aDrawRectangle
[nPos
];
263 rMapMode
= aDrawMapMode
[nPos
];
264 rRangeId
= aDrawRangeId
[nPos
];
268 static ScPreviewLocationEntry
* lcl_GetEntryByAddress( const boost::ptr_list
<ScPreviewLocationEntry
> &rEntries
,
269 const ScAddress
& rPos
, ScPreviewLocationType eType
)
271 boost::ptr_list
<ScPreviewLocationEntry
>::const_iterator it
;
272 for (it
= rEntries
.begin(); it
!= rEntries
.end(); ++it
)
274 if ( it
->eType
== eType
&& it
->aCellRange
.In( rPos
) )
275 return const_cast<ScPreviewLocationEntry
*>(&(*it
));
282 Rectangle
ScPreviewLocationData::GetOffsetPixel( const ScAddress
& rCellPos
, const ScRange
& rRange
) const
284 const double nScaleX
= HMM_PER_TWIPS
;
285 const double nScaleY
= HMM_PER_TWIPS
;
286 SCTAB nTab
= rRange
.aStart
.Tab();
289 SCCOL nEndCol
= rCellPos
.Col();
290 for (SCCOL nCol
= rRange
.aStart
.Col(); nCol
< nEndCol
; nCol
++)
292 sal_uInt16 nDocW
= pDoc
->GetColWidth( nCol
, nTab
);
294 nPosX
+= (long) (nDocW
* nScaleX
);
296 long nSizeX
= (long) ( pDoc
->GetColWidth( nEndCol
, nTab
) * nScaleX
);
298 SCROW nEndRow
= rCellPos
.Row();
299 long nPosY
= (long) pDoc
->GetScaledRowHeight( rRange
.aStart
.Row(),
300 nEndRow
, nTab
, nScaleY
);
301 long nSizeY
= (long) ( pDoc
->GetRowHeight( nEndRow
, nTab
) * nScaleY
);
303 Size
aOffsetLogic( nPosX
, nPosY
);
304 Size
aSizeLogic( nSizeX
, nSizeY
);
305 Size aOffsetPixel
= pWindow
->LogicToPixel( aOffsetLogic
, aCellMapMode
);
306 Size aSizePixel
= pWindow
->LogicToPixel( aSizeLogic
, aCellMapMode
);
308 return Rectangle( Point( aOffsetPixel
.Width(), aOffsetPixel
.Height() ), aSizePixel
);
311 sal_Bool
ScPreviewLocationData::GetCellPosition( const ScAddress
& rCellPos
, Rectangle
& rCellRect
) const
313 ScPreviewLocationEntry
* pEntry
= lcl_GetEntryByAddress( aEntries
, rCellPos
, SC_PLOC_CELLRANGE
);
316 Rectangle aOffsetRect
= GetOffsetPixel( rCellPos
, pEntry
->aCellRange
);
317 rCellRect
= Rectangle( aOffsetRect
.Left() + pEntry
->aPixelRect
.Left(),
318 aOffsetRect
.Top() + pEntry
->aPixelRect
.Top(),
319 aOffsetRect
.Right() + pEntry
->aPixelRect
.Left(),
320 aOffsetRect
.Bottom() + pEntry
->aPixelRect
.Top() );
326 sal_Bool
ScPreviewLocationData::HasCellsInRange( const Rectangle
& rVisiblePixel
) const
328 boost::ptr_list
<ScPreviewLocationEntry
>::const_iterator it
;
329 for (it
= aEntries
.begin(); it
!= aEntries
.end(); ++it
)
331 if ( it
->eType
== SC_PLOC_CELLRANGE
|| it
->eType
== SC_PLOC_COLHEADER
|| it
->eType
== SC_PLOC_ROWHEADER
)
332 if ( it
->aPixelRect
.IsOver( rVisiblePixel
) )
339 sal_Bool
ScPreviewLocationData::GetHeaderPosition( Rectangle
& rRect
) const
341 boost::ptr_list
<ScPreviewLocationEntry
>::const_iterator it
;
342 for (it
= aEntries
.begin(); it
!= aEntries
.end(); ++it
)
344 if ( it
->eType
== SC_PLOC_LEFTHEADER
|| it
->eType
== SC_PLOC_RIGHTHEADER
)
346 rRect
= it
->aPixelRect
;
354 sal_Bool
ScPreviewLocationData::GetFooterPosition( Rectangle
& rRect
) const
356 boost::ptr_list
<ScPreviewLocationEntry
>::const_iterator it
;
357 for (it
= aEntries
.begin(); it
!= aEntries
.end(); ++it
)
359 if ( it
->eType
== SC_PLOC_LEFTFOOTER
|| it
->eType
== SC_PLOC_RIGHTFOOTER
)
361 rRect
= it
->aPixelRect
;
369 sal_Bool
ScPreviewLocationData::IsHeaderLeft() const
371 boost::ptr_list
<ScPreviewLocationEntry
>::const_iterator it
;
372 for (it
= aEntries
.begin(); it
!= aEntries
.end(); ++it
)
374 if ( it
->eType
== SC_PLOC_LEFTHEADER
)
377 if ( it
->eType
== SC_PLOC_RIGHTHEADER
)
384 sal_Bool
ScPreviewLocationData::IsFooterLeft() const
386 boost::ptr_list
<ScPreviewLocationEntry
>::const_iterator it
;
387 for (it
= aEntries
.begin(); it
!= aEntries
.end(); ++it
)
389 if ( it
->eType
== SC_PLOC_LEFTFOOTER
)
392 if ( it
->eType
== SC_PLOC_RIGHTFOOTER
)
399 long ScPreviewLocationData::GetNoteCountInRange( const Rectangle
& rVisiblePixel
, sal_Bool bNoteMarks
) const
401 ScPreviewLocationType eType
= bNoteMarks
? SC_PLOC_NOTEMARK
: SC_PLOC_NOTETEXT
;
404 boost::ptr_list
<ScPreviewLocationEntry
>::const_iterator it
;
405 for (it
= aEntries
.begin(); it
!= aEntries
.end(); ++it
)
407 if ( it
->eType
== eType
&& it
->aPixelRect
.IsOver( rVisiblePixel
) )
414 sal_Bool
ScPreviewLocationData::GetNoteInRange( const Rectangle
& rVisiblePixel
, long nIndex
, sal_Bool bNoteMarks
,
415 ScAddress
& rCellPos
, Rectangle
& rNoteRect
) const
417 ScPreviewLocationType eType
= bNoteMarks
? SC_PLOC_NOTEMARK
: SC_PLOC_NOTETEXT
;
420 boost::ptr_list
<ScPreviewLocationEntry
>::const_iterator it
;
421 for (it
= aEntries
.begin(); it
!= aEntries
.end(); ++it
)
423 if ( it
->eType
== eType
&& it
->aPixelRect
.IsOver( rVisiblePixel
) )
425 if ( nPos
== sal::static_int_cast
<sal_uLong
>(nIndex
) )
427 rCellPos
= it
->aCellRange
.aStart
;
428 rNoteRect
= it
->aPixelRect
;
438 Rectangle
ScPreviewLocationData::GetNoteInRangeOutputRect(const Rectangle
& rVisiblePixel
, sal_Bool bNoteMarks
, const ScAddress
& aCellPos
) const
440 ScPreviewLocationType eType
= bNoteMarks
? SC_PLOC_NOTEMARK
: SC_PLOC_NOTETEXT
;
443 boost::ptr_list
<ScPreviewLocationEntry
>::const_iterator it
;
444 for (it
= aEntries
.begin(); it
!= aEntries
.end(); ++it
)
446 if ( it
->eType
== eType
&& it
->aPixelRect
.IsOver( rVisiblePixel
) )
448 if ( aCellPos
== it
->aCellRange
.aStart
)
449 return it
->aPixelRect
;
457 void ScPreviewLocationData::GetTableInfo( const Rectangle
& rVisiblePixel
, ScPreviewTableInfo
& rInfo
) const
459 const double nScaleX
= HMM_PER_TWIPS
;
460 const double nScaleY
= HMM_PER_TWIPS
;
462 // from left to right:
463 sal_Bool bHasHeaderCol
= false;
464 sal_Bool bHasRepCols
= false;
465 sal_Bool bHasMainCols
= false;
466 SCCOL nRepeatColStart
= 0;
467 SCCOL nRepeatColEnd
= 0;
468 SCCOL nMainColStart
= 0;
469 SCCOL nMainColEnd
= 0;
471 // from top to bottom:
472 sal_Bool bHasHeaderRow
= false;
473 sal_Bool bHasRepRows
= false;
474 sal_Bool bHasMainRows
= false;
475 SCROW nRepeatRowStart
= 0;
476 SCROW nRepeatRowEnd
= 0;
477 SCROW nMainRowStart
= 0;
478 SCROW nMainRowEnd
= 0;
480 Rectangle aHeaderRect
, aRepeatRect
, aMainRect
;
483 boost::ptr_list
<ScPreviewLocationEntry
>::const_iterator it
;
484 for (it
= aEntries
.begin(); it
!= aEntries
.end(); ++it
)
486 if ( it
->eType
== SC_PLOC_CELLRANGE
)
488 if ( it
->bRepeatCol
)
491 nRepeatColStart
= it
->aCellRange
.aStart
.Col();
492 nRepeatColEnd
= it
->aCellRange
.aEnd
.Col();
493 aRepeatRect
.Left() = it
->aPixelRect
.Left();
494 aRepeatRect
.Right() = it
->aPixelRect
.Right();
499 nMainColStart
= it
->aCellRange
.aStart
.Col();
500 nMainColEnd
= it
->aCellRange
.aEnd
.Col();
501 aMainRect
.Left() = it
->aPixelRect
.Left();
502 aMainRect
.Right() = it
->aPixelRect
.Right();
504 if ( it
->bRepeatRow
)
507 nRepeatRowStart
= it
->aCellRange
.aStart
.Row();
508 nRepeatRowEnd
= it
->aCellRange
.aEnd
.Row();
509 aRepeatRect
.Top() = it
->aPixelRect
.Top();
510 aRepeatRect
.Bottom() = it
->aPixelRect
.Bottom();
515 nMainRowStart
= it
->aCellRange
.aStart
.Row();
516 nMainRowEnd
= it
->aCellRange
.aEnd
.Row();
517 aMainRect
.Top() = it
->aPixelRect
.Top();
518 aMainRect
.Bottom() = it
->aPixelRect
.Bottom();
520 nTab
= it
->aCellRange
.aStart
.Tab(); //! store separately?
522 else if ( it
->eType
== SC_PLOC_ROWHEADER
)
524 // row headers result in an additional column
525 bHasHeaderCol
= true;
526 aHeaderRect
.Left() = it
->aPixelRect
.Left();
527 aHeaderRect
.Right() = it
->aPixelRect
.Right();
529 else if ( it
->eType
== SC_PLOC_COLHEADER
)
531 // column headers result in an additional row
532 bHasHeaderRow
= true;
533 aHeaderRect
.Top() = it
->aPixelRect
.Top();
534 aHeaderRect
.Bottom() = it
->aPixelRect
.Bottom();
547 for ( nCol
=nRepeatColStart
; nCol
<=nRepeatColEnd
; nCol
++ )
548 if (!pDoc
->ColHidden(nCol
, nTab
))
551 for ( nCol
=nMainColStart
; nCol
<=nMainColEnd
; nCol
++ )
552 if (!pDoc
->ColHidden(nCol
, nTab
))
557 ScPreviewColRowInfo
* pColInfo
= new ScPreviewColRowInfo
[ nColCount
];
562 pColInfo
[nColPos
].Set( sal_True
, 0, aHeaderRect
.Left(), aHeaderRect
.Right() );
568 for ( nCol
=nRepeatColStart
; nCol
<=nRepeatColEnd
; nCol
++ )
569 if (!pDoc
->ColHidden(nCol
, nTab
))
571 sal_uInt16 nDocW
= pDoc
->GetColWidth( nCol
, nTab
);
572 long nNextX
= nPosX
+ (long) (nDocW
* nScaleX
);
574 long nPixelStart
= pWindow
->LogicToPixel( Size( nPosX
, 0 ), aCellMapMode
).Width();
575 long nPixelEnd
= pWindow
->LogicToPixel( Size( nNextX
, 0 ), aCellMapMode
).Width() - 1;
576 pColInfo
[nColPos
].Set( false, nCol
,
577 aRepeatRect
.Left() + nPixelStart
,
578 aRepeatRect
.Left() + nPixelEnd
);
587 for ( nCol
=nMainColStart
; nCol
<=nMainColEnd
; nCol
++ )
588 if (!pDoc
->ColHidden(nCol
, nTab
))
590 sal_uInt16 nDocW
= pDoc
->GetColWidth( nCol
, nTab
);
591 long nNextX
= nPosX
+ (long) (nDocW
* nScaleX
);
593 long nPixelStart
= pWindow
->LogicToPixel( Size( nPosX
, 0 ), aCellMapMode
).Width();
594 long nPixelEnd
= pWindow
->LogicToPixel( Size( nNextX
, 0 ), aCellMapMode
).Width() - 1;
595 pColInfo
[nColPos
].Set( false, nCol
,
596 aMainRect
.Left() + nPixelStart
,
597 aMainRect
.Left() + nPixelEnd
);
603 rInfo
.SetColInfo( nColCount
, pColInfo
);
606 rInfo
.SetColInfo( 0, NULL
);
616 nRowCount
+= pDoc
->CountVisibleRows(nRepeatRowStart
, nRepeatRowEnd
, nTab
);
618 nRowCount
+= pDoc
->CountVisibleRows(nMainRowStart
, nMainRowEnd
, nTab
);
622 ScPreviewColRowInfo
* pRowInfo
= new ScPreviewColRowInfo
[ nRowCount
];
627 pRowInfo
[nRowPos
].Set( sal_True
, 0, aHeaderRect
.Top(), aHeaderRect
.Bottom() );
633 for (SCROW nRow
= nRepeatRowStart
; nRow
<= nRepeatRowEnd
; ++nRow
)
635 if (pDoc
->RowHidden(nRow
, nTab
))
638 sal_uInt16 nDocH
= pDoc
->GetOriginalHeight( nRow
, nTab
);
639 long nNextY
= nPosY
+ (long) (nDocH
* nScaleY
);
641 long nPixelStart
= pWindow
->LogicToPixel( Size( 0, nPosY
), aCellMapMode
).Height();
642 long nPixelEnd
= pWindow
->LogicToPixel( Size( 0, nNextY
), aCellMapMode
).Height() - 1;
643 pRowInfo
[nRowPos
].Set( false, nRow
,
644 aRepeatRect
.Top() + nPixelStart
,
645 aRepeatRect
.Top() + nPixelEnd
);
654 for (SCROW nRow
= nMainRowStart
; nRow
<= nMainRowEnd
; ++nRow
)
656 if (pDoc
->RowHidden(nRow
, nTab
))
659 sal_uInt16 nDocH
= pDoc
->GetOriginalHeight( nRow
, nTab
);
660 long nNextY
= nPosY
+ (long) (nDocH
* nScaleY
);
662 long nPixelStart
= pWindow
->LogicToPixel( Size( 0, nPosY
), aCellMapMode
).Height();
663 long nPixelEnd
= pWindow
->LogicToPixel( Size( 0, nNextY
), aCellMapMode
).Height() - 1;
664 pRowInfo
[nRowPos
].Set( false, nRow
,
665 aMainRect
.Top() + nPixelStart
,
666 aMainRect
.Top() + nPixelEnd
);
672 rInfo
.SetRowInfo( nRowCount
, pRowInfo
);
675 rInfo
.SetRowInfo( 0, NULL
);
678 // limit to visible area
681 rInfo
.SetTab( nTab
);
682 rInfo
.LimitToArea( rVisiblePixel
);
685 Rectangle
ScPreviewLocationData::GetHeaderCellOutputRect(const Rectangle
& rVisRect
, const ScAddress
& rCellPos
, sal_Bool bColHeader
) const
687 // first a stupid implementation
688 // NN says here should be done more
690 ScPreviewTableInfo aTableInfo
;
691 GetTableInfo( rVisRect
, aTableInfo
);
693 if ( (rCellPos
.Col() >= 0) &&
694 (rCellPos
.Row() >= 0) && (rCellPos
.Col() < aTableInfo
.GetCols()) &&
695 (rCellPos
.Row() < aTableInfo
.GetRows()) )
700 nCol
= rCellPos
.Col();
702 nRow
= rCellPos
.Row();
703 const ScPreviewColRowInfo
& rColInfo
= aTableInfo
.GetColInfo()[nCol
];
704 const ScPreviewColRowInfo
& rRowInfo
= aTableInfo
.GetRowInfo()[nRow
];
706 if ( rColInfo
.bIsHeader
|| rRowInfo
.bIsHeader
)
707 aClipRect
= Rectangle( rColInfo
.nPixelStart
, rRowInfo
.nPixelStart
, rColInfo
.nPixelEnd
, rRowInfo
.nPixelEnd
);
712 Rectangle
ScPreviewLocationData::GetCellOutputRect(const ScAddress
& rCellPos
) const
714 // first a stupid implementation
715 // NN says here should be done more
717 GetCellPosition(rCellPos
, aRect
);
721 // GetMainCellRange is used for links in PDF export
723 sal_Bool
ScPreviewLocationData::GetMainCellRange( ScRange
& rRange
, Rectangle
& rPixRect
) const
725 boost::ptr_list
<ScPreviewLocationEntry
>::const_iterator it
;
726 for (it
= aEntries
.begin(); it
!= aEntries
.end(); ++it
)
728 if ( it
->eType
== SC_PLOC_CELLRANGE
&& !it
->bRepeatCol
&& !it
->bRepeatRow
)
730 rRange
= it
->aCellRange
;
731 rPixRect
= it
->aPixelRect
;
739 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */