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 <prevloc.hxx>
21 #include <document.hxx>
23 #include <o3tl/unit_conversion.hxx>
24 #include <osl/diagnose.h>
25 #include <vcl/outdev.hxx>
29 enum ScPreviewLocationType
: sal_uInt8
44 struct ScPreviewLocationEntry
46 tools::Rectangle aPixelRect
;
48 ScPreviewLocationType eType
;
52 ScPreviewLocationEntry( ScPreviewLocationType eNewType
, const tools::Rectangle
& rPixel
, const ScRange
& rRange
,
53 bool bRepCol
, bool bRepRow
) :
57 bRepeatCol( bRepCol
),
63 ScPreviewTableInfo::ScPreviewTableInfo() :
70 ScPreviewTableInfo::~ScPreviewTableInfo()
74 void ScPreviewTableInfo::SetTab( SCTAB nNewTab
)
79 void ScPreviewTableInfo::SetColInfo( SCCOL nCount
, ScPreviewColRowInfo
* pNewInfo
)
81 pColInfo
.reset(pNewInfo
);
85 void ScPreviewTableInfo::SetRowInfo( SCROW nCount
, ScPreviewColRowInfo
* pNewInfo
)
87 pRowInfo
.reset(pNewInfo
);
91 void ScPreviewTableInfo::LimitToArea( const tools::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, nullptr ); // 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
)
138 SCROW nNewCount
= nEnd
- nStart
;
139 ScPreviewColRowInfo
* pNewInfo
= new ScPreviewColRowInfo
[nNewCount
];
140 for (SCROW i
=0; i
<nNewCount
; i
++)
141 pNewInfo
[i
] = pRowInfo
[nStart
+ i
];
142 SetRowInfo( nNewCount
, pNewInfo
);
145 SetRowInfo( 0, nullptr ); // 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 tools::Rectangle
& rRect
, const ScRange
& rRange
, bool bRepCol
, bool bRepRow
,
179 const MapMode
& rDrawMap
)
181 tools::Rectangle
aPixelRect( pWindow
->LogicToPixel( rRect
) );
182 m_Entries
.push_front( std::make_unique
<ScPreviewLocationEntry
>(SC_PLOC_CELLRANGE
, aPixelRect
, rRange
, bRepCol
, bRepRow
) );
184 OSL_ENSURE( nDrawRanges
< SC_PREVIEW_MAXRANGES
, "too many ranges" );
186 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
;
210 void ScPreviewLocationData::AddColHeaders( const tools::Rectangle
& rRect
, SCCOL nStartCol
, SCCOL nEndCol
, bool bRepCol
)
212 SCTAB nTab
= 0; //! ?
213 ScRange
aRange( nStartCol
, 0, nTab
, nEndCol
, 0, nTab
);
214 tools::Rectangle
aPixelRect( pWindow
->LogicToPixel( rRect
) );
216 m_Entries
.push_front( std::make_unique
<ScPreviewLocationEntry
>(SC_PLOC_COLHEADER
, aPixelRect
, aRange
, bRepCol
, false) );
219 void ScPreviewLocationData::AddRowHeaders( const tools::Rectangle
& rRect
, SCROW nStartRow
, SCROW nEndRow
, bool bRepRow
)
221 SCTAB nTab
= 0; //! ?
222 ScRange
aRange( 0, nStartRow
, nTab
, 0, nEndRow
, nTab
);
223 tools::Rectangle
aPixelRect( pWindow
->LogicToPixel( rRect
) );
225 m_Entries
.push_front( std::make_unique
<ScPreviewLocationEntry
>(SC_PLOC_ROWHEADER
, aPixelRect
, aRange
, false, bRepRow
) );
228 void ScPreviewLocationData::AddHeaderFooter( const tools::Rectangle
& rRect
, bool bHeader
, bool bLeft
)
230 ScRange aRange
; //! ?
231 tools::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 m_Entries
.push_front( std::make_unique
<ScPreviewLocationEntry
>(eType
, aPixelRect
, aRange
, false, false) );
240 void ScPreviewLocationData::AddNoteMark( const tools::Rectangle
& rRect
, const ScAddress
& rPos
)
242 ScRange
aRange( rPos
);
243 tools::Rectangle
aPixelRect( pWindow
->LogicToPixel( rRect
) );
245 m_Entries
.push_front( std::make_unique
<ScPreviewLocationEntry
>(SC_PLOC_NOTEMARK
, aPixelRect
, aRange
, false, false) );
248 void ScPreviewLocationData::AddNoteText( const tools::Rectangle
& rRect
, const ScAddress
& rPos
)
250 ScRange
aRange( rPos
);
251 tools::Rectangle
aPixelRect( pWindow
->LogicToPixel( rRect
) );
253 m_Entries
.push_front( std::make_unique
<ScPreviewLocationEntry
>(SC_PLOC_NOTETEXT
, aPixelRect
, aRange
, false, false) );
256 void ScPreviewLocationData::GetDrawRange( sal_uInt16 nPos
, tools::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(
268 ScPreviewLocationData::Entries_t
const& rEntries
,
269 const ScAddress
& rPos
, ScPreviewLocationType
const eType
)
271 for (auto const& it
: rEntries
)
273 if ( it
->eType
== eType
&& it
->aCellRange
.Contains( rPos
) )
280 tools::Rectangle
ScPreviewLocationData::GetOffsetPixel( const ScAddress
& rCellPos
, const ScRange
& rRange
) const
282 SCTAB nTab
= rRange
.aStart
.Tab();
284 tools::Long nPosX
= 0;
285 SCCOL nEndCol
= rCellPos
.Col();
286 for (SCCOL nCol
= rRange
.aStart
.Col(); nCol
< nEndCol
; nCol
++)
288 sal_uInt16 nDocW
= pDoc
->GetColWidth( nCol
, nTab
);
290 nPosX
+= o3tl::convert(nDocW
, o3tl::Length::twip
, o3tl::Length::mm100
);
292 const tools::Long nSizeX
293 = o3tl::convert(pDoc
->GetColWidth(nEndCol
, nTab
), o3tl::Length::twip
, o3tl::Length::mm100
);
295 SCROW nEndRow
= rCellPos
.Row();
296 tools::Long nPosY
= o3tl::convert(pDoc
->GetRowHeight(rRange
.aStart
.Row(), nEndRow
, nTab
),
297 o3tl::Length::twip
, o3tl::Length::mm100
);
299 = o3tl::convert(pDoc
->GetRowHeight(nEndRow
, nTab
), o3tl::Length::twip
, o3tl::Length::mm100
);
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 tools::Rectangle( Point( aOffsetPixel
.Width(), aOffsetPixel
.Height() ), aSizePixel
);
309 void ScPreviewLocationData::GetCellPosition( const ScAddress
& rCellPos
, tools::Rectangle
& rCellRect
) const
311 ScPreviewLocationEntry
* pEntry
= lcl_GetEntryByAddress( m_Entries
, rCellPos
, SC_PLOC_CELLRANGE
);
314 tools::Rectangle aOffsetRect
= GetOffsetPixel( rCellPos
, pEntry
->aCellRange
);
315 rCellRect
= tools::Rectangle( aOffsetRect
.Left() + pEntry
->aPixelRect
.Left(),
316 aOffsetRect
.Top() + pEntry
->aPixelRect
.Top(),
317 aOffsetRect
.Right() + pEntry
->aPixelRect
.Left(),
318 aOffsetRect
.Bottom() + pEntry
->aPixelRect
.Top() );
322 bool ScPreviewLocationData::HasCellsInRange( const tools::Rectangle
& rVisiblePixel
) const
324 for (auto const& it
: m_Entries
)
326 if ( it
->eType
== SC_PLOC_CELLRANGE
|| it
->eType
== SC_PLOC_COLHEADER
|| it
->eType
== SC_PLOC_ROWHEADER
)
327 if ( it
->aPixelRect
.Overlaps( rVisiblePixel
) )
334 bool ScPreviewLocationData::GetHeaderPosition( tools::Rectangle
& rRect
) const
336 for (auto const& it
: m_Entries
)
338 if ( it
->eType
== SC_PLOC_LEFTHEADER
|| it
->eType
== SC_PLOC_RIGHTHEADER
)
340 rRect
= it
->aPixelRect
;
348 bool ScPreviewLocationData::GetFooterPosition( tools::Rectangle
& rRect
) const
350 for (auto const& it
: m_Entries
)
352 if ( it
->eType
== SC_PLOC_LEFTFOOTER
|| it
->eType
== SC_PLOC_RIGHTFOOTER
)
354 rRect
= it
->aPixelRect
;
362 bool ScPreviewLocationData::IsHeaderLeft() const
364 for (auto const& it
: m_Entries
)
366 if ( it
->eType
== SC_PLOC_LEFTHEADER
)
369 if ( it
->eType
== SC_PLOC_RIGHTHEADER
)
376 bool ScPreviewLocationData::IsFooterLeft() const
378 for (auto const& it
: m_Entries
)
380 if ( it
->eType
== SC_PLOC_LEFTFOOTER
)
383 if ( it
->eType
== SC_PLOC_RIGHTFOOTER
)
390 tools::Long
ScPreviewLocationData::GetNoteCountInRange( const tools::Rectangle
& rVisiblePixel
, bool bNoteMarks
) const
392 ScPreviewLocationType eType
= bNoteMarks
? SC_PLOC_NOTEMARK
: SC_PLOC_NOTETEXT
;
395 for (auto const& it
: m_Entries
)
397 if ( it
->eType
== eType
&& it
->aPixelRect
.Overlaps( rVisiblePixel
) )
404 bool ScPreviewLocationData::GetNoteInRange( const tools::Rectangle
& rVisiblePixel
, tools::Long nIndex
, bool bNoteMarks
,
405 ScAddress
& rCellPos
, tools::Rectangle
& rNoteRect
) const
407 ScPreviewLocationType eType
= bNoteMarks
? SC_PLOC_NOTEMARK
: SC_PLOC_NOTETEXT
;
410 for (auto const& it
: m_Entries
)
412 if ( it
->eType
== eType
&& it
->aPixelRect
.Overlaps( rVisiblePixel
) )
414 if ( nPos
== sal::static_int_cast
<sal_uLong
>(nIndex
) )
416 rCellPos
= it
->aCellRange
.aStart
;
417 rNoteRect
= it
->aPixelRect
;
427 tools::Rectangle
ScPreviewLocationData::GetNoteInRangeOutputRect(const tools::Rectangle
& rVisiblePixel
, bool bNoteMarks
, const ScAddress
& aCellPos
) const
429 ScPreviewLocationType eType
= bNoteMarks
? SC_PLOC_NOTEMARK
: SC_PLOC_NOTETEXT
;
431 for (auto const& it
: m_Entries
)
433 if ( it
->eType
== eType
&& it
->aPixelRect
.Overlaps( rVisiblePixel
) )
435 if ( aCellPos
== it
->aCellRange
.aStart
)
436 return it
->aPixelRect
;
440 return tools::Rectangle();
443 void ScPreviewLocationData::GetTableInfo( const tools::Rectangle
& rVisiblePixel
, ScPreviewTableInfo
& rInfo
) const
445 // from left to right:
446 bool bHasHeaderCol
= false;
447 bool bHasRepCols
= false;
448 bool bHasMainCols
= false;
449 SCCOL nRepeatColStart
= 0;
450 SCCOL nRepeatColEnd
= 0;
451 SCCOL nMainColStart
= 0;
452 SCCOL nMainColEnd
= 0;
454 // from top to bottom:
455 bool bHasHeaderRow
= false;
456 bool bHasRepRows
= false;
457 bool bHasMainRows
= false;
458 SCROW nRepeatRowStart
= 0;
459 SCROW nRepeatRowEnd
= 0;
460 SCROW nMainRowStart
= 0;
461 SCROW nMainRowEnd
= 0;
463 tools::Rectangle aHeaderRect
, aRepeatRect
, aMainRect
;
466 for (auto const& it
: m_Entries
)
468 if ( it
->eType
== SC_PLOC_CELLRANGE
)
470 if ( it
->bRepeatCol
)
473 nRepeatColStart
= it
->aCellRange
.aStart
.Col();
474 nRepeatColEnd
= it
->aCellRange
.aEnd
.Col();
475 aRepeatRect
.SetLeft( it
->aPixelRect
.Left() );
476 aRepeatRect
.SetRight( it
->aPixelRect
.Right() );
481 nMainColStart
= it
->aCellRange
.aStart
.Col();
482 nMainColEnd
= it
->aCellRange
.aEnd
.Col();
483 aMainRect
.SetLeft( it
->aPixelRect
.Left() );
484 aMainRect
.SetRight( it
->aPixelRect
.Right() );
486 if ( it
->bRepeatRow
)
489 nRepeatRowStart
= it
->aCellRange
.aStart
.Row();
490 nRepeatRowEnd
= it
->aCellRange
.aEnd
.Row();
491 aRepeatRect
.SetTop( it
->aPixelRect
.Top() );
492 aRepeatRect
.SetBottom( it
->aPixelRect
.Bottom() );
497 nMainRowStart
= it
->aCellRange
.aStart
.Row();
498 nMainRowEnd
= it
->aCellRange
.aEnd
.Row();
499 aMainRect
.SetTop( it
->aPixelRect
.Top() );
500 aMainRect
.SetBottom( it
->aPixelRect
.Bottom() );
502 nTab
= it
->aCellRange
.aStart
.Tab(); //! store separately?
504 else if ( it
->eType
== SC_PLOC_ROWHEADER
)
506 // row headers result in an additional column
507 bHasHeaderCol
= true;
508 aHeaderRect
.SetLeft( it
->aPixelRect
.Left() );
509 aHeaderRect
.SetRight( it
->aPixelRect
.Right() );
511 else if ( it
->eType
== SC_PLOC_COLHEADER
)
513 // column headers result in an additional row
514 bHasHeaderRow
= true;
515 aHeaderRect
.SetTop( it
->aPixelRect
.Top() );
516 aHeaderRect
.SetBottom( it
->aPixelRect
.Bottom() );
527 for ( nCol
=nRepeatColStart
; nCol
<=nRepeatColEnd
; nCol
++ )
528 if (!pDoc
->ColHidden(nCol
, nTab
))
531 for ( nCol
=nMainColStart
; nCol
<=nMainColEnd
; nCol
++ )
532 if (!pDoc
->ColHidden(nCol
, nTab
))
537 ScPreviewColRowInfo
* pColInfo
= new ScPreviewColRowInfo
[ nColCount
];
542 pColInfo
[nColPos
].Set( true, 0, aHeaderRect
.Left(), aHeaderRect
.Right() );
547 tools::Long nPosX
= 0;
548 for ( nCol
=nRepeatColStart
; nCol
<=nRepeatColEnd
; nCol
++ )
549 if (!pDoc
->ColHidden(nCol
, nTab
))
551 sal_uInt16 nDocW
= pDoc
->GetColWidth( nCol
, nTab
);
553 = nPosX
+ o3tl::convert(nDocW
, o3tl::Length::twip
, o3tl::Length::mm100
);
555 tools::Long nPixelStart
= pWindow
->LogicToPixel( Size( nPosX
, 0 ), aCellMapMode
).Width();
556 tools::Long nPixelEnd
= pWindow
->LogicToPixel( Size( nNextX
, 0 ), aCellMapMode
).Width() - 1;
557 pColInfo
[nColPos
].Set( false, nCol
,
558 aRepeatRect
.Left() + nPixelStart
,
559 aRepeatRect
.Left() + nPixelEnd
);
567 tools::Long nPosX
= 0;
568 for ( nCol
=nMainColStart
; nCol
<=nMainColEnd
; nCol
++ )
569 if (!pDoc
->ColHidden(nCol
, nTab
))
571 sal_uInt16 nDocW
= pDoc
->GetColWidth( nCol
, nTab
);
573 = nPosX
+ o3tl::convert(nDocW
, o3tl::Length::twip
, o3tl::Length::mm100
);
575 tools::Long nPixelStart
= pWindow
->LogicToPixel( Size( nPosX
, 0 ), aCellMapMode
).Width();
576 tools::Long nPixelEnd
= pWindow
->LogicToPixel( Size( nNextX
, 0 ), aCellMapMode
).Width() - 1;
577 pColInfo
[nColPos
].Set( false, nCol
,
578 aMainRect
.Left() + nPixelStart
,
579 aMainRect
.Left() + nPixelEnd
);
585 rInfo
.SetColInfo( nColCount
, pColInfo
);
588 rInfo
.SetColInfo( 0, nullptr );
596 nRowCount
+= pDoc
->CountVisibleRows(nRepeatRowStart
, nRepeatRowEnd
, nTab
);
598 nRowCount
+= pDoc
->CountVisibleRows(nMainRowStart
, nMainRowEnd
, nTab
);
602 ScPreviewColRowInfo
* pRowInfo
= new ScPreviewColRowInfo
[ nRowCount
];
607 pRowInfo
[nRowPos
].Set( true, 0, aHeaderRect
.Top(), aHeaderRect
.Bottom() );
612 tools::Long nPosY
= 0;
613 for (SCROW nRow
= nRepeatRowStart
; nRow
<= nRepeatRowEnd
; ++nRow
)
615 if (pDoc
->RowHidden(nRow
, nTab
))
618 sal_uInt16 nDocH
= pDoc
->GetOriginalHeight( nRow
, nTab
);
620 = nPosY
+ o3tl::convert(nDocH
, o3tl::Length::twip
, o3tl::Length::mm100
);
622 tools::Long nPixelStart
= pWindow
->LogicToPixel( Size( 0, nPosY
), aCellMapMode
).Height();
623 tools::Long nPixelEnd
= pWindow
->LogicToPixel( Size( 0, nNextY
), aCellMapMode
).Height() - 1;
624 pRowInfo
[nRowPos
].Set( false, nRow
,
625 aRepeatRect
.Top() + nPixelStart
,
626 aRepeatRect
.Top() + nPixelEnd
);
634 tools::Long nPosY
= 0;
635 for (SCROW nRow
= nMainRowStart
; nRow
<= nMainRowEnd
; ++nRow
)
637 if (pDoc
->RowHidden(nRow
, nTab
))
640 sal_uInt16 nDocH
= pDoc
->GetOriginalHeight( nRow
, nTab
);
642 = nPosY
+ o3tl::convert(nDocH
, o3tl::Length::twip
, o3tl::Length::mm100
);
644 tools::Long nPixelStart
= pWindow
->LogicToPixel( Size( 0, nPosY
), aCellMapMode
).Height();
645 tools::Long nPixelEnd
= pWindow
->LogicToPixel( Size( 0, nNextY
), aCellMapMode
).Height() - 1;
646 pRowInfo
[nRowPos
].Set( false, nRow
,
647 aMainRect
.Top() + nPixelStart
,
648 aMainRect
.Top() + nPixelEnd
);
654 rInfo
.SetRowInfo( nRowCount
, pRowInfo
);
657 rInfo
.SetRowInfo( 0, nullptr );
659 // limit to visible area
661 rInfo
.SetTab( nTab
);
662 rInfo
.LimitToArea( rVisiblePixel
);
665 tools::Rectangle
ScPreviewLocationData::GetHeaderCellOutputRect(const tools::Rectangle
& rVisRect
, const ScAddress
& rCellPos
, bool bColHeader
) const
667 // first a stupid implementation
668 // NN says here should be done more
669 tools::Rectangle aClipRect
;
670 ScPreviewTableInfo aTableInfo
;
671 GetTableInfo( rVisRect
, aTableInfo
);
673 if ( (rCellPos
.Col() >= 0) &&
674 (rCellPos
.Row() >= 0) && (rCellPos
.Col() < aTableInfo
.GetCols()) &&
675 (rCellPos
.Row() < aTableInfo
.GetRows()) )
680 nCol
= rCellPos
.Col();
682 nRow
= rCellPos
.Row();
683 const ScPreviewColRowInfo
& rColInfo
= aTableInfo
.GetColInfo()[nCol
];
684 const ScPreviewColRowInfo
& rRowInfo
= aTableInfo
.GetRowInfo()[nRow
];
686 if ( rColInfo
.bIsHeader
|| rRowInfo
.bIsHeader
)
687 aClipRect
= tools::Rectangle( rColInfo
.nPixelStart
, rRowInfo
.nPixelStart
, rColInfo
.nPixelEnd
, rRowInfo
.nPixelEnd
);
692 tools::Rectangle
ScPreviewLocationData::GetCellOutputRect(const ScAddress
& rCellPos
) const
694 // first a stupid implementation
695 // NN says here should be done more
696 tools::Rectangle aRect
;
697 GetCellPosition(rCellPos
, aRect
);
701 // GetMainCellRange is used for links in PDF export
703 bool ScPreviewLocationData::GetMainCellRange( ScRange
& rRange
, tools::Rectangle
& rPixRect
) const
705 for (auto const& it
: m_Entries
)
707 if ( it
->eType
== SC_PLOC_CELLRANGE
&& !it
->bRepeatCol
&& !it
->bRepeatRow
)
709 rRange
= it
->aCellRange
;
710 rPixRect
= it
->aPixelRect
;
718 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */