LibreOffice Module sc (master) 1
printfun.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#include <scitems.hxx>
21#include <editeng/eeitem.hxx>
22
23#include <printfun.hxx>
24
27#include <editeng/boxitem.hxx>
28#include <editeng/brushitem.hxx>
29#include <svtools/colorcfg.hxx>
30#include <editeng/editstat.hxx>
31#include <svx/fmview.hxx>
33#include <editeng/lrspitem.hxx>
34#include <editeng/paperinf.hxx>
35#include <editeng/pbinitem.hxx>
36#include <editeng/shaditem.hxx>
37#include <editeng/sizeitem.hxx>
38#include <editeng/fhgtitem.hxx>
39#include <editeng/ulspitem.hxx>
40#include <sfx2/printer.hxx>
41#include <tools/multisel.hxx>
42#include <sfx2/docfile.hxx>
43#include <tools/urlobj.hxx>
44#include <osl/diagnose.h>
45
46#include <editutil.hxx>
47#include <docsh.hxx>
48#include <output.hxx>
49#include <viewdata.hxx>
50#include <viewopti.hxx>
51#include <stlpool.hxx>
52#include <pagepar.hxx>
53#include <attrib.hxx>
54#include <patattr.hxx>
55#include <docpool.hxx>
56#include <dociter.hxx>
57#include <globstr.hrc>
58#include <scresid.hxx>
59#include <pagedata.hxx>
60#include <printopt.hxx>
61#include <prevloc.hxx>
62#include <scmod.hxx>
63#include <drwlayer.hxx>
64#include <fillinfo.hxx>
65#include <postit.hxx>
66
67#include <memory>
68#include <com/sun/star/document/XDocumentProperties.hpp>
69
70#define ZOOM_MIN 10
71
72namespace{
73
74bool lcl_GetBool(const SfxItemSet* pSet, sal_uInt16 nWhich)
75{
76 return static_cast<const SfxBoolItem&>(pSet->Get(nWhich)).GetValue();
77}
78
79sal_uInt16 lcl_GetUShort(const SfxItemSet* pSet, sal_uInt16 nWhich)
80{
81 return static_cast<const SfxUInt16Item&>(pSet->Get(nWhich)).GetValue();
82}
83
84bool lcl_GetShow(const SfxItemSet* pSet, sal_uInt16 nWhich)
85{
86 return ScVObjMode::VOBJ_MODE_SHOW == static_cast<const ScViewObjectModeItem&>(pSet->Get(nWhich)).GetValue();
87}
88
89
90} // namespace
91
93{
95 nEndRow = r.nEndRow;
96 nPagesX = r.nPagesX;
97 aHidden = r.aHidden;
98 aHidden.resize(nPagesX, false);
99}
100
102{
104 nEndRow = r.nEndRow;
105 nPagesX = r.nPagesX;
106 aHidden = r.aHidden;
107 aHidden.resize(nPagesX, false);
108 return *this;
109}
110
112{
113 nPagesX = nNew;
114 aHidden.resize(nPagesX, false);
115}
116
118{
119 if ( nX < nPagesX )
120 {
121 if ( nX+1 == nPagesX ) // last page?
122 --nPagesX;
123 else
124 {
125 aHidden.resize(nPagesX, false);
126 aHidden[nX] = true;
127 }
128 }
129}
130
131bool ScPageRowEntry::IsHidden(size_t nX) const
132{
133 return nX >= nPagesX || aHidden[nX];
134}
135
137{
138 if (!aHidden.empty())
139 {
140 size_t nVis = 0;
141 for (size_t i=0; i<nPagesX; i++)
142 if (!aHidden[i])
143 ++nVis;
144 return nVis;
145 }
146 else
147 return nPagesX;
148}
149
150static tools::Long lcl_LineTotal(const ::editeng::SvxBorderLine* pLine)
151{
152 return pLine ? ( pLine->GetScaledWidth() ) : 0;
153}
154
156{
158
159 SfxPrinter* pDocPrinter = rDoc.GetPrinter(); // use the printer, even for preview
160 if (pDocPrinter)
161 aOldPrinterMode = pDocPrinter->GetMapMode();
162
163 // unified MapMode for all calls (e.g. Repaint!!!)
164 // else, EditEngine outputs different text heights
165 pDev->SetMapMode(MapMode(MapUnit::MapPixel));
166
167 pBorderItem = nullptr;
168 pBackgroundItem = nullptr;
169 pShadowItem = nullptr;
170
171 pEditEngine = nullptr;
172 pEditDefaults = nullptr;
173
175 SfxStyleSheetBase* pStyleSheet = pStylePool->Find(
177 SfxStyleFamily::Page );
178 if (pStyleSheet)
179 pParamSet = &pStyleSheet->GetItemSet();
180 else
181 {
182 OSL_FAIL("Template not found" );
183 pParamSet = nullptr;
184 }
185
186 if (!bFromPrintState)
187 nZoom = 100;
188 nManualZoom = 100;
189 bClearWin = false;
190 bUseStyleColor = false;
191 bIsRender = false;
192
193 InitParam(pOptions);
194
195 pPageData = nullptr; // is only needed for initialisation
196}
197
199 tools::Long nPage, tools::Long nDocP, const ScRange* pArea,
200 const ScPrintOptions* pOptions,
201 ScPageBreakData* pData )
202 : pDocShell ( pShell ),
203 rDoc(pDocShell->GetDocument()),
204 pPrinter ( pNewPrinter ),
205 pDrawView ( nullptr ),
206 nPrintTab ( nTab ),
207 nPageStart ( nPage ),
208 nDocPages ( nDocP ),
209 pUserArea ( pArea ),
210 bFromPrintState ( false ),
211 bSourceRangeValid ( false ),
212 bPrintCurrentTable ( false ),
213 bMultiArea ( false ),
214 mbHasPrintRange(true),
215 nTabPages ( 0 ),
216 nTotalPages ( 0 ),
217 bPrintAreaValid ( false ),
218 pPageData ( pData )
219{
220 pDev = pPrinter.get();
221 aSrcOffset = pPrinter->PixelToLogic(pPrinter->GetPageOffsetPixel(), MapMode(MapUnit::Map100thMM));
222 m_aRanges.m_xPageEndX = std::make_shared<std::vector<SCCOL>>();
223 m_aRanges.m_xPageEndY = std::make_shared<std::vector<SCROW>>();
224 m_aRanges.m_xPageRows = std::make_shared<std::map<size_t, ScPageRowEntry>>();
225 Construct( pOptions );
226}
227
229 const ScPrintState& rState, const ScPrintOptions* pOptions)
230 : pDocShell ( pShell ),
231 rDoc(pDocShell->GetDocument()),
232 pPrinter ( pNewPrinter ),
233 pDrawView ( nullptr ),
234 pUserArea ( nullptr ),
235 bSourceRangeValid ( false ),
236 bPrintCurrentTable ( false ),
237 bMultiArea ( false ),
238 mbHasPrintRange(true),
239 pPageData ( nullptr )
240{
241 pDev = pPrinter.get();
242
243 nPrintTab = rState.nPrintTab;
244 nStartCol = rState.nStartCol;
245 nStartRow = rState.nStartRow;
246 nEndCol = rState.nEndCol;
247 nEndRow = rState.nEndRow;
249 nZoom = rState.nZoom;
250 m_aRanges.m_nPagesX = rState.nPagesX;
251 m_aRanges.m_nPagesY = rState.nPagesY;
252 nTabPages = rState.nTabPages;
253 nTotalPages = rState.nTotalPages;
254 nPageStart = rState.nPageStart;
255 nDocPages = rState.nDocPages;
256 bFromPrintState = true;
257
258 if (rState.bSavedStateRanges)
259 {
260 m_aRanges.m_nTotalY = rState.nTotalY;
265 }
266 else
267 {
268 m_aRanges.m_xPageEndX = std::make_shared<std::vector<SCCOL>>();
269 m_aRanges.m_xPageEndY = std::make_shared<std::vector<SCROW>>();
270 m_aRanges.m_xPageRows = std::make_shared<std::map<size_t, ScPageRowEntry>>();
271 }
272
273 aSrcOffset = pPrinter->PixelToLogic(pPrinter->GetPageOffsetPixel(), MapMode(MapUnit::Map100thMM));
274 Construct( pOptions );
275}
276
278 tools::Long nPage, tools::Long nDocP, const ScRange* pArea,
279 const ScPrintOptions* pOptions )
280 : pDocShell ( pShell ),
281 rDoc(pDocShell->GetDocument()),
282 pPrinter ( nullptr ),
283 pDrawView ( nullptr ),
284 nPrintTab ( nTab ),
285 nPageStart ( nPage ),
286 nDocPages ( nDocP ),
287 pUserArea ( pArea ),
288 bFromPrintState ( false ),
289 bSourceRangeValid ( false ),
290 bPrintCurrentTable ( false ),
291 bMultiArea ( false ),
292 mbHasPrintRange(true),
293 nTabPages ( 0 ),
294 nTotalPages ( 0 ),
295 bPrintAreaValid ( false ),
296 pPageData ( nullptr )
297{
298 pDev = pOutDev;
299 m_aRanges.m_xPageEndX = std::make_shared<std::vector<SCCOL>>();
300 m_aRanges.m_xPageEndY = std::make_shared<std::vector<SCROW>>();
301 m_aRanges.m_xPageRows = std::make_shared<std::map<size_t, ScPageRowEntry>>();
302 Construct( pOptions );
303}
304
306 const ScPrintState& rState, const ScPrintOptions* pOptions )
307 : pDocShell ( pShell ),
308 rDoc(pDocShell->GetDocument()),
309 pPrinter ( nullptr ),
310 pDrawView ( nullptr ),
311 pUserArea ( nullptr ),
312 bSourceRangeValid ( false ),
313 bPrintCurrentTable ( false ),
314 bMultiArea ( false ),
315 mbHasPrintRange(true),
316 pPageData ( nullptr )
317{
318 pDev = pOutDev;
319
320 nPrintTab = rState.nPrintTab;
321 nStartCol = rState.nStartCol;
322 nStartRow = rState.nStartRow;
323 nEndCol = rState.nEndCol;
324 nEndRow = rState.nEndRow;
326 nZoom = rState.nZoom;
327 m_aRanges.m_nPagesX = rState.nPagesX;
328 m_aRanges.m_nPagesY = rState.nPagesY;
329 nTabPages = rState.nTabPages;
330 nTotalPages = rState.nTotalPages;
331 nPageStart = rState.nPageStart;
332 nDocPages = rState.nDocPages;
333 bFromPrintState = true;
334
335 if (rState.bSavedStateRanges)
336 {
337 m_aRanges.m_nTotalY = rState.nTotalY;
342 }
343 else
344 {
345 m_aRanges.m_xPageEndX = std::make_shared<std::vector<SCCOL>>();
346 m_aRanges.m_xPageEndY = std::make_shared<std::vector<SCROW>>();
347 m_aRanges.m_xPageRows = std::make_shared<std::map<size_t, ScPageRowEntry>>();
348 }
349
350 Construct( pOptions );
351}
352
353void ScPrintFunc::GetPrintState(ScPrintState& rState, bool bSavePageRanges)
354{
355 rState.nPrintTab = nPrintTab;
356 rState.nStartCol = nStartCol;
357 rState.nStartRow = nStartRow;
358 rState.nEndCol = nEndCol;
359 rState.nEndRow = nEndRow;
361 rState.nZoom = nZoom;
362 rState.nPagesX = m_aRanges.m_nPagesX;
363 rState.nPagesY = m_aRanges.m_nPagesY;
364 rState.nTabPages = nTabPages;
365 rState.nTotalPages = nTotalPages;
366 rState.nPageStart = nPageStart;
367 rState.nDocPages = nDocPages;
368 if (bSavePageRanges)
369 {
370 rState.bSavedStateRanges = true;
371 rState.nTotalY = m_aRanges.m_nTotalY;
376 }
377}
378
380{
381 rRange = aLastSourceRange;
382 return bSourceRangeValid;
383}
384
386{
387 if (!pPageData)
388 return;
389
390 sal_uInt16 nCount = sal::static_int_cast<sal_uInt16>( pPageData->GetCount() );
391 ScPrintRangeData& rData = pPageData->GetData(nCount); // count up
392
393 assert( bPrintAreaValid );
396 // #i123672#
397 if(m_aRanges.m_xPageEndX->empty())
398 {
399 OSL_ENSURE(false, "vector access error for maPageEndX (!)");
400 }
401 else
402 {
404 }
405
406 // #i123672#
407 if(m_aRanges.m_xPageEndY->empty())
408 {
409 OSL_ENSURE(false, "vector access error for maPageEndY (!)");
410 }
411 else
412 {
414 }
415
416 // Settings
419}
420
422{
423 pEditDefaults.reset();
424 pEditEngine.reset();
425
426 // Printer settings are now restored from outside
427
428 // For DrawingLayer/Charts, the MapMode of the printer (RefDevice) must always be correct
429 SfxPrinter* pDocPrinter = rDoc.GetPrinter(); // use Preview also for the printer
430 if (pDocPrinter)
431 pDocPrinter->SetMapMode(aOldPrinterMode);
432}
433
435{
436 pDrawView = pNew;
437}
438
439static void lcl_HidePrint( const ScTableInfo& rTabInfo, SCCOL nX1, SCCOL nX2 )
440{
441 for (SCSIZE nArrY=1; nArrY+1<rTabInfo.mnArrCount; nArrY++)
442 {
443 RowInfo* pThisRowInfo = &rTabInfo.mpRowInfo[nArrY];
444 for (SCCOL nX=nX1; nX<=nX2; nX++)
445 {
446 ScCellInfo& rCellInfo = pThisRowInfo->cellInfo(nX);
447 ScBasicCellInfo& rBasicCellInfo = pThisRowInfo->basicCellInfo(nX);
448 if (!rBasicCellInfo.bEmptyCellText)
449 if (rCellInfo.pPatternAttr->
450 GetItem(ATTR_PROTECTION, rCellInfo.pConditionSet).GetHidePrint())
451 {
452 rCellInfo.maCell.clear();
453 rBasicCellInfo.bEmptyCellText = true;
454 }
455 }
456 }
457}
458
459// output to Device (static)
460//
461// us used for:
462// - Clipboard/Bitmap
463// - Ole-Object (DocShell::Draw)
464// - Preview of templates
465
466void ScPrintFunc::DrawToDev(ScDocument& rDoc, OutputDevice* pDev, double /* nPrintFactor */,
467 const tools::Rectangle& rBound, ScViewData* pViewData, bool bMetaFile)
468{
470
471 SCTAB nTab = 0;
472 if (pViewData)
473 nTab = pViewData->GetTabNo();
474
475 bool bDoGrid, bNullVal, bFormula;
477 SfxStyleSheetBase* pStyleSheet = pStylePool->Find( rDoc.GetPageStyle( nTab ), SfxStyleFamily::Page );
478 if (pStyleSheet)
479 {
480 SfxItemSet& rSet = pStyleSheet->GetItemSet();
481 bDoGrid = rSet.Get(ATTR_PAGE_GRID).GetValue();
482 bNullVal = rSet.Get(ATTR_PAGE_NULLVALS).GetValue();
483 bFormula = rSet.Get(ATTR_PAGE_FORMULAS).GetValue();
484 }
485 else
486 {
487 const ScViewOptions& rOpt = rDoc.GetViewOptions();
488 bDoGrid = rOpt.GetOption(VOPT_GRID);
489 bNullVal = rOpt.GetOption(VOPT_NULLVALS);
490 bFormula = rOpt.GetOption(VOPT_FORMULAS);
491 }
492
493 MapMode aMode = pDev->GetMapMode();
494
495 tools::Rectangle aRect = rBound;
496
497 if (aRect.Right() < aRect.Left() || aRect.Bottom() < aRect.Top())
498 aRect = tools::Rectangle( Point(), pDev->GetOutputSize() );
499
500 SCCOL nX1 = 0;
501 SCROW nY1 = 0;
502 SCCOL nX2 = OLE_STD_CELLS_X - 1;
503 SCROW nY2 = OLE_STD_CELLS_Y - 1;
504 if (bMetaFile)
505 {
506 ScRange aRange = rDoc.GetRange( nTab, rBound );
507 nX1 = aRange.aStart.Col();
508 nY1 = aRange.aStart.Row();
509 nX2 = aRange.aEnd.Col();
510 nY2 = aRange.aEnd.Row();
511 }
512 else if (pViewData)
513 {
514 ScSplitPos eWhich = pViewData->GetActivePart();
515 ScHSplitPos eHWhich = WhichH(eWhich);
516 ScVSplitPos eVWhich = WhichV(eWhich);
517 nX1 = pViewData->GetPosX(eHWhich);
518 nY1 = pViewData->GetPosY(eVWhich);
519 nX2 = nX1 + pViewData->VisibleCellsX(eHWhich);
520 if (nX2>nX1) --nX2;
521 nY2 = nY1 + pViewData->VisibleCellsY(eVWhich);
522 if (nY2>nY1) --nY2;
523 }
524
525 if (nX1 > rDoc.MaxCol()) nX1 = rDoc.MaxCol();
526 if (nX2 > rDoc.MaxCol()) nX2 = rDoc.MaxCol();
527 if (nY1 > rDoc.MaxRow()) nY1 = rDoc.MaxRow();
528 if (nY2 > rDoc.MaxRow()) nY2 = rDoc.MaxRow();
529
530 tools::Long nDevSizeX = aRect.Right()-aRect.Left()+1;
531 tools::Long nDevSizeY = aRect.Bottom()-aRect.Top()+1;
532
533 tools::Long nTwipsSizeX = 0;
534 for (SCCOL i=nX1; i<=nX2; i++)
535 nTwipsSizeX += rDoc.GetColWidth( i, nTab );
536 tools::Long nTwipsSizeY = rDoc.GetRowHeight( nY1, nY2, nTab );
537
538 // if no lines, still space for the outline frame (20 Twips = 1pt)
539 // (HasLines initializes aLines to 0,0,0,0)
540 nTwipsSizeX += 20;
541 nTwipsSizeY += 20;
542
543 double nScaleX = static_cast<double>(nDevSizeX) / nTwipsSizeX;
544 double nScaleY = static_cast<double>(nDevSizeY) / nTwipsSizeY;
545
547 ScRange aERange;
548 bool bEmbed = rDoc.IsEmbedded();
549 if (bEmbed)
550 {
551 rDoc.GetEmbedded(aERange);
553 }
554
555 // Assemble data
556
557 ScTableInfo aTabInfo;
558 rDoc.FillInfo( aTabInfo, nX1, nY1, nX2, nY2, nTab,
559 nScaleX, nScaleY, false, bFormula );
560 lcl_HidePrint( aTabInfo, nX1, nX2 );
561
562 if (bEmbed)
563 rDoc.SetEmbedded(aERange);
564
565 tools::Long nScrX = aRect.Left();
566 tools::Long nScrY = aRect.Top();
567
568 // If no lines, still leave space for grid lines
569 // (would be elseways cut away)
570 nScrX += 1;
571 nScrY += 1;
572
573 ScOutputData aOutputData( pDev, OUTTYPE_PRINTER, aTabInfo, &rDoc, nTab,
574 nScrX, nScrY, nX1, nY1, nX2, nY2, nScaleX, nScaleY );
575 aOutputData.SetMetaFileMode(bMetaFile);
576 aOutputData.SetShowNullValues(bNullVal);
577 aOutputData.SetShowFormulas(bFormula);
578
579 ScDrawLayer* pModel = rDoc.GetDrawLayer();
580 std::unique_ptr<FmFormView> pDrawView;
581
582 if( pModel )
583 {
584 pDrawView.reset(
585 new FmFormView(
586 *pModel,
587 pDev));
590 aOutputData.SetDrawView( pDrawView.get() );
591 }
592
594
595 if ( bMetaFile && pDev->IsVirtual() )
596 aOutputData.SetSnapPixel();
597
598 Point aLogStart = pDev->PixelToLogic(Point(nScrX, nScrY), MapMode(MapUnit::Map100thMM));
599 tools::Long nLogStX = aLogStart.X();
600 tools::Long nLogStY = aLogStart.Y();
601
603
604 if (!bMetaFile && pViewData)
605 pDev->SetMapMode(pViewData->GetLogicMode(pViewData->GetActivePart()));
606
607 // #i72502#
608 const Point aMMOffset(aOutputData.PrePrintDrawingLayer(nLogStX, nLogStY));
609 aOutputData.PrintDrawingLayer(SC_LAYER_BACK, aMMOffset);
610
611 if (!bMetaFile && pViewData)
612 pDev->SetMapMode(aMode);
613
614 aOutputData.DrawBackground(*pDev);
615
616 aOutputData.DrawShadow();
617 aOutputData.DrawFrame(*pDev);
618 aOutputData.DrawSparklines(*pDev);
619 aOutputData.DrawStrings();
620
621 if (!bMetaFile && pViewData)
622 pDev->SetMapMode(pViewData->GetLogicMode(pViewData->GetActivePart()));
623
624 aOutputData.DrawEdit(!bMetaFile);
625
626 if (bDoGrid)
627 {
628 if (!bMetaFile && pViewData)
629 pDev->SetMapMode(aMode);
630
631 aOutputData.DrawGrid(*pDev, true, false); // no page breaks
632
633 pDev->SetLineColor( COL_BLACK );
634
635 Size aOne = pDev->PixelToLogic( Size(1,1) );
636 if (bMetaFile)
637 aOne = Size(1,1); // compatible with DrawGrid
638 tools::Long nRight = nScrX + aOutputData.GetScrW() - aOne.Width();
639 tools::Long nBottom = nScrY + aOutputData.GetScrH() - aOne.Height();
640
641 bool bLayoutRTL = rDoc.IsLayoutRTL( nTab );
642
643 // extra line at the left edge for left-to-right, right for right-to-left
644 if ( bLayoutRTL )
645 pDev->DrawLine( Point(nRight,nScrY), Point(nRight,nBottom) );
646 else
647 pDev->DrawLine( Point(nScrX,nScrY), Point(nScrX,nBottom) );
648 // extra line at the top in both cases
649 pDev->DrawLine( Point(nScrX,nScrY), Point(nRight,nScrY) );
650 }
651
652 // #i72502#
653 aOutputData.PrintDrawingLayer(SC_LAYER_FRONT, aMMOffset);
654 aOutputData.PrintDrawingLayer(SC_LAYER_INTERN, aMMOffset);
655 aOutputData.PostPrintDrawingLayer(aMMOffset); // #i74768#
656}
657
658// Printing
659
660static void lcl_FillHFParam( ScPrintHFParam& rParam, const SfxItemSet* pHFSet )
661{
662 // nDistance must be initialized differently before
663
664 if ( pHFSet == nullptr )
665 {
666 rParam.bEnable = false;
667 rParam.pBorder = nullptr;
668 rParam.pBack = nullptr;
669 rParam.pShadow = nullptr;
670 }
671 else
672 {
673 rParam.bEnable = pHFSet->Get(ATTR_PAGE_ON).GetValue();
674 rParam.bDynamic = pHFSet->Get(ATTR_PAGE_DYNAMIC).GetValue();
675 rParam.bShared = pHFSet->Get(ATTR_PAGE_SHARED).GetValue();
676 rParam.bSharedFirst = pHFSet->Get(ATTR_PAGE_SHARED_FIRST).GetValue();
677 rParam.nHeight = pHFSet->Get(ATTR_PAGE_SIZE).GetSize().Height();
678 const SvxLRSpaceItem* pHFLR = &pHFSet->Get(ATTR_LRSPACE);
679 tools::Long nTmp;
680 nTmp = pHFLR->GetLeft();
681 rParam.nLeft = nTmp < 0 ? 0 : sal_uInt16(nTmp);
682 nTmp = pHFLR->GetRight();
683 rParam.nRight = nTmp < 0 ? 0 : sal_uInt16(nTmp);
684 rParam.pBorder = &pHFSet->Get(ATTR_BORDER);
685 rParam.pBack = &pHFSet->Get(ATTR_BACKGROUND);
686 rParam.pShadow = &pHFSet->Get(ATTR_SHADOW);
687
688// now back in the dialog:
689// rParam.nHeight += rParam.nDistance; // not in the dialog any more ???
690
691 rParam.nHeight += lcl_LineTotal( rParam.pBorder->GetTop() ) +
692 lcl_LineTotal( rParam.pBorder->GetBottom() );
693
694 rParam.nManHeight = rParam.nHeight;
695 }
696
697 if (!rParam.bEnable)
698 rParam.nHeight = 0;
699}
700
701// bNew = TRUE: search for used part of the document
702// bNew = FALSE: only limit whole lines/columns
703
705{
706 SCCOL nOldEndCol = nEndCol; // only important for !bNew
707 SCROW nOldEndRow = nEndRow;
708 bool bChangeCol = true; // at bNew both are being adjusted
709 bool bChangeRow = true;
710
711 bool bNotes = aTableParam.bNotes;
712 if ( bNew )
713 {
714 nStartCol = 0;
715 nStartRow = 0;
716 if (!rDoc.GetPrintArea( nPrintTab, nEndCol, nEndRow, bNotes ))
717 return false; // nothing
718 bPrintAreaValid = true;
719 }
720 else
721 {
722 bool bFound = true;
723 bChangeCol = ( nStartCol == 0 && nEndCol == rDoc.MaxCol() );
724 bChangeRow = ( nStartRow == 0 && nEndRow == rDoc.MaxRow() );
725 bool bForcedChangeRow = false;
726
727 // #i53558# Crop entire column of old row limit to real print area with
728 // some fuzzyness.
729 if (!bChangeRow && nStartRow == 0)
730 {
731 SCROW nPAEndRow;
732 bFound = rDoc.GetPrintAreaVer( nPrintTab, nStartCol, nEndCol, nPAEndRow, bNotes );
733 // Say we don't want to print more than ~1000 empty rows, which are
734 // about 14 pages intentionally left blank...
735 const SCROW nFuzzy = 23*42;
736 if (nPAEndRow + nFuzzy < nEndRow)
737 {
738 bForcedChangeRow = true;
739 nEndRow = nPAEndRow;
740 }
741 else
742 bFound = true; // user seems to _want_ to print some empty rows
743 }
744 // TODO: in case we extend the number of columns we may have to do the
745 // same for horizontal cropping.
746
747 if ( bChangeCol && bChangeRow )
748 bFound = rDoc.GetPrintArea( nPrintTab, nEndCol, nEndRow, bNotes );
749 else if ( bChangeCol )
751 else if ( bChangeRow )
752 bFound = rDoc.GetPrintAreaVer( nPrintTab, nStartCol, nEndCol, nEndRow, bNotes );
753
754 if (!bFound)
755 return false; // empty
756
757 bPrintAreaValid = true;
758 if (bForcedChangeRow)
759 bChangeRow = true;
760 }
761
762 assert( bPrintAreaValid );
763 rDoc.ExtendMerge( nStartCol,nStartRow, nEndCol,nEndRow, nPrintTab ); // no Refresh, incl. Attrs
764
765 if ( bChangeCol )
766 {
767 OutputDevice* pRefDev = rDoc.GetPrinter(); // use the printer also for Preview
768 pRefDev->SetMapMode(MapMode(MapUnit::MapPixel)); // important for GetNeededSize
769
770 rDoc.ExtendPrintArea( pRefDev,
772 // changing nEndCol
773 }
774
775 if ( nEndCol < rDoc.MaxCol() && rDoc.HasAttrib(
777 ++nEndCol;
778 if ( nEndRow < rDoc.MaxRow() && rDoc.HasAttrib(
780 ++nEndRow;
781
782 if (!bChangeCol) nEndCol = nOldEndCol;
783 if (!bChangeRow) nEndRow = nOldEndRow;
784
785 return true;
786}
787
789{
790 if (!pObject)
791 return 0;
792
793 pEditEngine->SetTextNewDefaults( *pObject, *pEditDefaults, false );
794
795 return static_cast<tools::Long>(pEditEngine->GetTextHeight());
796}
797
798// nZoom must be set !!!
799// and the respective Twip-MapMode configured
800
802{
803 OSL_ENSURE( aPageSize.Width(), "UpdateHFHeight without aPageSize");
804
805 if (!(rParam.bEnable && rParam.bDynamic))
806 return;
807
808 // calculate nHeight from content
809
811 tools::Long nPaperWidth = ( aPageSize.Width() - nLeftMargin - nRightMargin -
812 rParam.nLeft - rParam.nRight ) * 100 / nZoom;
813 if (rParam.pBorder)
814 nPaperWidth -= ( rParam.pBorder->GetDistance(SvxBoxItemLine::LEFT) +
815 rParam.pBorder->GetDistance(SvxBoxItemLine::RIGHT) +
816 lcl_LineTotal(rParam.pBorder->GetLeft()) +
817 lcl_LineTotal(rParam.pBorder->GetRight()) ) * 100 / nZoom;
818
819 if (rParam.pShadow && rParam.pShadow->GetLocation() != SvxShadowLocation::NONE)
820 nPaperWidth -= ( rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::LEFT) +
821 rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::RIGHT) ) * 100 / nZoom;
822
823 pEditEngine->SetPaperSize( Size( nPaperWidth, 10000 ) );
824
825 tools::Long nMaxHeight = 0;
826 if ( rParam.pLeft )
827 {
828 nMaxHeight = std::max( nMaxHeight, TextHeight( rParam.pLeft->GetLeftArea() ) );
829 nMaxHeight = std::max( nMaxHeight, TextHeight( rParam.pLeft->GetCenterArea() ) );
830 nMaxHeight = std::max( nMaxHeight, TextHeight( rParam.pLeft->GetRightArea() ) );
831 }
832 if ( rParam.pRight )
833 {
834 nMaxHeight = std::max( nMaxHeight, TextHeight( rParam.pRight->GetLeftArea() ) );
835 nMaxHeight = std::max( nMaxHeight, TextHeight( rParam.pRight->GetCenterArea() ) );
836 nMaxHeight = std::max( nMaxHeight, TextHeight( rParam.pRight->GetRightArea() ) );
837 }
838 if ( rParam.pFirst )
839 {
840 nMaxHeight = std::max( nMaxHeight, TextHeight( rParam.pFirst->GetLeftArea() ) );
841 nMaxHeight = std::max( nMaxHeight, TextHeight( rParam.pFirst->GetCenterArea() ) );
842 nMaxHeight = std::max( nMaxHeight, TextHeight( rParam.pFirst->GetRightArea() ) );
843 }
844
845 rParam.nHeight = nMaxHeight + rParam.nDistance;
846 if (rParam.pBorder)
847 rParam.nHeight += rParam.pBorder->GetDistance(SvxBoxItemLine::TOP) +
848 rParam.pBorder->GetDistance(SvxBoxItemLine::BOTTOM) +
849 lcl_LineTotal( rParam.pBorder->GetTop() ) +
850 lcl_LineTotal( rParam.pBorder->GetBottom() );
851 if (rParam.pShadow && rParam.pShadow->GetLocation() != SvxShadowLocation::NONE)
852 rParam.nHeight += rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::TOP) +
853 rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::BOTTOM);
854
855 if (rParam.nHeight < rParam.nManHeight)
856 rParam.nHeight = rParam.nManHeight; // configured minimum
857}
858
860{
861 if (!pParamSet)
862 return;
863
864 // TabPage "Page"
865 const SvxLRSpaceItem* pLRItem = &pParamSet->Get( ATTR_LRSPACE );
866 tools::Long nTmp;
867 nTmp = pLRItem->GetLeft();
868 nLeftMargin = nTmp < 0 ? 0 : sal_uInt16(nTmp);
869 nTmp = pLRItem->GetRight();
870 nRightMargin = nTmp < 0 ? 0 : sal_uInt16(nTmp);
871 const SvxULSpaceItem* pULItem = &pParamSet->Get( ATTR_ULSPACE );
872 nTopMargin = pULItem->GetUpper();
873 nBottomMargin = pULItem->GetLower();
874
875 const SvxPageItem* pPageItem = &pParamSet->Get( ATTR_PAGE );
876 nPageUsage = pPageItem->GetPageUsage();
877 bLandscape = pPageItem->IsLandscape();
878 aFieldData.eNumType = pPageItem->GetNumType();
879
882
884 if ( !aPageSize.Width() || !aPageSize.Height() )
885 {
886 OSL_FAIL("PageSize Null ?!?!?");
888 }
889
893
894 // TabPage "Headline"
895
899
900 const SfxItemSet* pHeaderSet = nullptr;
901 if ( const SvxSetItem* pHeaderSetItem = pParamSet->GetItemIfSet( ATTR_PAGE_HEADERSET, false ) )
902 {
903 pHeaderSet = &pHeaderSetItem->GetItemSet();
904 // Headline has space below
905 aHdr.nDistance = pHeaderSet->Get(ATTR_ULSPACE).GetLower();
906 }
907 lcl_FillHFParam( aHdr, pHeaderSet );
908
909 // TabPage "Footline"
910
914
915 const SfxItemSet* pFooterSet = nullptr;
916 if ( const SvxSetItem* pFooterSetItem = pParamSet->GetItemIfSet( ATTR_PAGE_FOOTERSET, false ) )
917 {
918 pFooterSet = &pFooterSetItem->GetItemSet();
919 // Footline has space above
920 aFtr.nDistance = pFooterSet->Get(ATTR_ULSPACE).GetUpper();
921 }
922 lcl_FillHFParam( aFtr, pFooterSet );
923
924 // Compile Table-/Area-Params from single Items
925
926 // TabPage "Table"
927
928 const SfxUInt16Item* pScaleItem = nullptr;
929 const ScPageScaleToItem* pScaleToItem = nullptr;
930 const SfxUInt16Item* pScaleToPagesItem = nullptr;
931 SfxItemState eState;
932
933 eState = pParamSet->GetItemState( ATTR_PAGE_SCALE, false,
934 reinterpret_cast<const SfxPoolItem**>(&pScaleItem) );
935 if ( SfxItemState::DEFAULT == eState )
936 pScaleItem = &pParamSet->GetPool()->GetDefaultItem( ATTR_PAGE_SCALE );
937
938 eState = pParamSet->GetItemState( ATTR_PAGE_SCALETO, false,
939 reinterpret_cast<const SfxPoolItem**>(&pScaleToItem) );
940 if ( SfxItemState::DEFAULT == eState )
941 pScaleToItem = &pParamSet->GetPool()->GetDefaultItem( ATTR_PAGE_SCALETO );
942
944 reinterpret_cast<const SfxPoolItem**>(&pScaleToPagesItem) );
945 if ( SfxItemState::DEFAULT == eState )
946 pScaleToPagesItem = &pParamSet->GetPool()->GetDefaultItem( ATTR_PAGE_SCALETOPAGES );
947
948 OSL_ENSURE( pScaleItem && pScaleToItem && pScaleToPagesItem, "Missing ScaleItem! :-/" );
949
963 aTableParam.nFirstPageNo = static_cast<sal_uInt16>(nPageStart); // from previous table
964
965 if ( pScaleItem && pScaleToItem && pScaleToPagesItem )
966 {
967 sal_uInt16 nScaleAll = pScaleItem->GetValue();
968 sal_uInt16 nScaleToPages = pScaleToPagesItem->GetValue();
969
970 aTableParam.bScaleNone = (nScaleAll == 100);
971 aTableParam.bScaleAll = (nScaleAll > 0 );
972 aTableParam.bScaleTo = pScaleToItem->IsValid();
973 aTableParam.bScalePageNum = (nScaleToPages > 0 );
974 aTableParam.nScaleAll = nScaleAll;
975 aTableParam.nScaleWidth = pScaleToItem->GetWidth();
976 aTableParam.nScaleHeight = pScaleToItem->GetHeight();
977 aTableParam.nScalePageNum = nScaleToPages;
978 }
979 else
980 {
981 aTableParam.bScaleNone = true;
982 aTableParam.bScaleAll = false;
983 aTableParam.bScaleTo = false;
989 }
990
991 // skip empty pages only if options with that flag are passed
992 aTableParam.bSkipEmpty = pOptions && pOptions->GetSkipEmpty();
993 if ( pPageData )
994 aTableParam.bSkipEmpty = false;
995 // If pPageData is set, only the breaks are interesting for the
996 // pagebreak preview, empty pages are not addressed separately.
997
998 aTableParam.bForceBreaks = pOptions && pOptions->GetForceBreaks();
999
1000 // TabPage "Parts":
1001
1003 const ScRange* pPrintArea = rDoc.GetPrintRange( nPrintTab, 0 );
1004 std::optional<ScRange> oRepeatCol = rDoc.GetRepeatColRange( nPrintTab );
1005 std::optional<ScRange> oRepeatRow = rDoc.GetRepeatRowRange( nPrintTab );
1006
1007 // ignoring ATTR_PAGE_PRINTTABLES
1008
1009 bool bHasPrintRange = rDoc.HasPrintRange();
1010 sal_uInt16 nPrintRangeCount = rDoc.GetPrintRangeCount(nPrintTab);
1011 bool bPrintEntireSheet = rDoc.IsPrintEntireSheet(nPrintTab);
1012
1013 if (!bPrintEntireSheet && !nPrintRangeCount)
1014 mbHasPrintRange = false;
1015
1016 if ( pUserArea ) // UserArea (selection) has priority
1017 {
1019 aAreaParam.bPrintArea = true; // Selection
1021
1022 // The table-query is already in DocShell::Print, here always
1025 }
1026 else if (bHasPrintRange)
1027 {
1028 if ( pPrintArea ) // at least one set?
1029 {
1031 aAreaParam.bPrintArea = true;
1032 aAreaParam.aPrintArea = *pPrintArea;
1033
1034 bMultiArea = nPrintRangeCount > 1;
1035 }
1036 else
1037 {
1038 // do not print hidden sheets with "Print entire sheet" flag
1040 aAreaParam.bPrintArea = !bPrintCurrentTable; // otherwise the table is always counted
1041 }
1042 }
1043 else
1044 {
1045 // don't print hidden tables if there's no print range defined there
1046 if ( rDoc.IsVisible( nPrintTab ) )
1047 {
1048 aAreaParam.bPrintArea = false;
1049 bPrintCurrentTable = true;
1050 }
1051 else
1052 {
1053 aAreaParam.bPrintArea = true; // otherwise the table is always counted
1054 bPrintCurrentTable = false;
1055 }
1056 }
1057
1058 if ( oRepeatCol )
1059 {
1060 aAreaParam.bRepeatCol = true;
1061 nRepeatStartCol = oRepeatCol->aStart.Col();
1062 nRepeatEndCol = oRepeatCol->aEnd .Col();
1063 }
1064 else
1065 {
1066 aAreaParam.bRepeatCol = false;
1068 }
1069
1070 if ( oRepeatRow )
1071 {
1072 aAreaParam.bRepeatRow = true;
1073 nRepeatStartRow = oRepeatRow->aStart.Row();
1074 nRepeatEndRow = oRepeatRow->aEnd .Row();
1075 }
1076 else
1077 {
1078 aAreaParam.bRepeatRow = false;
1080 }
1081
1082 // Split pages
1083
1084 if (!bPrintAreaValid)
1085 {
1086 nTabPages = CountPages(); // also calculates zoom
1089 }
1090 else
1091 {
1092 CalcPages(); // search breaks only
1093 CountNotePages(); // Count notes, even if number of pages is already known
1094 }
1095
1096 if (nDocPages)
1098 else
1100
1102
1103 if( pDocShell->getDocProperties()->getTitle().getLength() != 0 )
1105 else
1107
1108 const INetURLObject& rURLObj = pDocShell->GetMedium()->GetURLObject();
1110 if ( !aFieldData.aLongDocName.isEmpty() )
1112 else
1114
1115 // Printer settings (Orientation, Paper) at DoPrint
1116}
1117
1119{
1120 Size aSize = aPageSize;
1121 aSize.AdjustWidth( -(nLeftMargin + nRightMargin) );
1123 aSize.AdjustHeight( -(aHdr.nHeight + aFtr.nHeight) );
1124 return aSize;
1125}
1126
1127void ScPrintFunc::GetScaleData( Size& rPhysSize, tools::Long& rDocHdr, tools::Long& rDocFtr )
1128{
1129 rPhysSize = aPageSize;
1130 rPhysSize.AdjustWidth( -(nLeftMargin + nRightMargin) );
1131 rPhysSize.AdjustHeight( -(nTopMargin + nBottomMargin) );
1132
1133 rDocHdr = aHdr.nHeight;
1134 rDocFtr = aFtr.nHeight;
1135}
1136
1137void ScPrintFunc::SetDateTime( const DateTime& rDateTime )
1138{
1139 aFieldData.aDateTime = rDateTime;
1140}
1141
1142static void lcl_DrawGraphic( const Graphic &rGraphic, vcl::RenderContext& rOutDev,
1143 const tools::Rectangle &rGrf, const tools::Rectangle &rOut )
1144{
1145 const bool bNotInside = !rOut.Contains( rGrf );
1146 if ( bNotInside )
1147 {
1148 rOutDev.Push();
1149 rOutDev.IntersectClipRegion( rOut );
1150 }
1151
1152 rGraphic.Draw(rOutDev, rGrf.TopLeft(), rGrf.GetSize());
1153
1154 if ( bNotInside )
1155 rOutDev.Pop();
1156}
1157
1158static void lcl_DrawGraphic( const SvxBrushItem &rBrush, vcl::RenderContext& rOutDev, const OutputDevice* pRefDev,
1159 const tools::Rectangle &rOrg, const tools::Rectangle &rOut,
1160 OUString const & referer )
1161{
1162 Size aGrfSize(0,0);
1163 const Graphic *pGraphic = rBrush.GetGraphic(referer);
1165 if ( pGraphic && pGraphic->IsSupportedGraphic() )
1166 {
1167 const MapMode aMapMM( MapUnit::Map100thMM );
1168 if ( pGraphic->GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel )
1169 aGrfSize = pRefDev->PixelToLogic( pGraphic->GetPrefSize(), aMapMM );
1170 else
1171 aGrfSize = OutputDevice::LogicToLogic( pGraphic->GetPrefSize(),
1172 pGraphic->GetPrefMapMode(), aMapMM );
1173 ePos = rBrush.GetGraphicPos();
1174 }
1175 else
1176 ePos = GPOS_NONE;
1177
1178 Point aPos;
1179 Size aDrawSize = aGrfSize;
1180
1181 bool bDraw = true;
1182 switch ( ePos )
1183 {
1184 case GPOS_LT: aPos = rOrg.TopLeft();
1185 break;
1186 case GPOS_MT: aPos.setY( rOrg.Top() );
1187 aPos.setX( rOrg.Left() + rOrg.GetSize().Width()/2 - aGrfSize.Width()/2 );
1188 break;
1189 case GPOS_RT: aPos.setY( rOrg.Top() );
1190 aPos.setX( rOrg.Right() - aGrfSize.Width() );
1191 break;
1192
1193 case GPOS_LM: aPos.setY( rOrg.Top() + rOrg.GetSize().Height()/2 - aGrfSize.Height()/2 );
1194 aPos.setX( rOrg.Left() );
1195 break;
1196 case GPOS_MM: aPos.setY( rOrg.Top() + rOrg.GetSize().Height()/2 - aGrfSize.Height()/2 );
1197 aPos.setX( rOrg.Left() + rOrg.GetSize().Width()/2 - aGrfSize.Width()/2 );
1198 break;
1199 case GPOS_RM: aPos.setY( rOrg.Top() + rOrg.GetSize().Height()/2 - aGrfSize.Height()/2 );
1200 aPos.setX( rOrg.Right() - aGrfSize.Width() );
1201 break;
1202
1203 case GPOS_LB: aPos.setY( rOrg.Bottom() - aGrfSize.Height() );
1204 aPos.setX( rOrg.Left() );
1205 break;
1206 case GPOS_MB: aPos.setY( rOrg.Bottom() - aGrfSize.Height() );
1207 aPos.setX( rOrg.Left() + rOrg.GetSize().Width()/2 - aGrfSize.Width()/2 );
1208 break;
1209 case GPOS_RB: aPos.setY( rOrg.Bottom() - aGrfSize.Height() );
1210 aPos.setX( rOrg.Right() - aGrfSize.Width() );
1211 break;
1212
1213 case GPOS_AREA:
1214 aPos = rOrg.TopLeft();
1215 aDrawSize = rOrg.GetSize();
1216 break;
1217 case GPOS_TILED:
1218 {
1219 // use GraphicObject::DrawTiled instead of an own loop
1220 // (pixel rounding is handled correctly, and a very small bitmap
1221 // is duplicated into a bigger one for better performance)
1222
1223 GraphicObject aObject( *pGraphic );
1224
1225 if( rOutDev.GetOutDevType() == OUTDEV_PDF &&
1226 (aObject.GetType() == GraphicType::Bitmap || aObject.GetType() == GraphicType::Default) )
1227 {
1228 // For PDF export, every draw
1229 // operation for bitmaps takes a noticeable
1230 // amount of place (~50 characters). Thus,
1231 // optimize between tile bitmap size and
1232 // number of drawing operations here.
1233 //
1234 // A_out
1235 // n_chars = k1 * ---------- + k2 * A_bitmap
1236 // A_bitmap
1237 //
1238 // minimum n_chars is obtained for (derive for
1239 // A_bitmap, set to 0, take positive
1240 // solution):
1241 // k1
1242 // A_bitmap = Sqrt( ---- A_out )
1243 // k2
1244 //
1245 // where k1 is the number of chars per draw
1246 // operation, and k2 is the number of chars
1247 // per bitmap pixel. This is approximately 50
1248 // and 7 for current PDF writer, respectively.
1249
1250 const double k1( 50 );
1251 const double k2( 7 );
1252 const Size aSize( rOrg.GetSize() );
1253 const double Abitmap( k1/k2 * aSize.Width()*aSize.Height() );
1254
1255 aObject.DrawTiled( rOutDev, rOrg, aGrfSize, Size(0,0),
1256 ::std::max( 128, static_cast<int>( sqrt(sqrt( Abitmap)) + .5 ) ) );
1257 }
1258 else
1259 {
1260 aObject.DrawTiled( rOutDev, rOrg, aGrfSize, Size(0,0) );
1261 }
1262
1263 bDraw = false;
1264 }
1265 break;
1266
1267 case GPOS_NONE:
1268 bDraw = false;
1269 break;
1270
1271 default: OSL_ENSURE( false, "new Graphic position?" );
1272 }
1273 tools::Rectangle aGrf( aPos,aDrawSize );
1274 if ( bDraw && aGrf.Overlaps( rOut ) )
1275 {
1276 lcl_DrawGraphic( *pGraphic, rOutDev, aGrf, rOut );
1277 }
1278}
1279
1280// The frame is drawn inwards
1281
1283 const SvxBoxItem* pBorderData, const SvxBrushItem* pBackground,
1284 const SvxShadowItem* pShadow )
1285{
1287
1288 if (pBorderData)
1289 if ( !pBorderData->GetTop() && !pBorderData->GetBottom() && !pBorderData->GetLeft() &&
1290 !pBorderData->GetRight() )
1291 pBorderData = nullptr;
1292
1293 if (!pBorderData && !pBackground && !pShadow)
1294 return; // nothing to do
1295
1296 tools::Long nLeft = 0;
1297 tools::Long nRight = 0;
1298 tools::Long nTop = 0;
1299 tools::Long nBottom = 0;
1300
1301 // aFrameRect - outside around frame, without shadow
1302 if ( pShadow && pShadow->GetLocation() != SvxShadowLocation::NONE )
1303 {
1304 nLeft += static_cast<tools::Long>( pShadow->CalcShadowSpace(SvxShadowItemSide::LEFT) * nScaleX );
1305 nRight += static_cast<tools::Long>( pShadow->CalcShadowSpace(SvxShadowItemSide::RIGHT) * nScaleX );
1306 nTop += static_cast<tools::Long>( pShadow->CalcShadowSpace(SvxShadowItemSide::TOP) * nScaleY );
1307 nBottom += static_cast<tools::Long>( pShadow->CalcShadowSpace(SvxShadowItemSide::BOTTOM) * nScaleY );
1308 }
1309 tools::Rectangle aFrameRect( Point(nScrX+nLeft, nScrY+nTop),
1310 Size(nScrW-nLeft-nRight, nScrH-nTop-nBottom) );
1311
1312 // center of frame, to paint lines through OutputData
1313 if (pBorderData)
1314 {
1315 nLeft += static_cast<tools::Long>( lcl_LineTotal(pBorderData->GetLeft()) * nScaleX / 2 );
1316 nRight += static_cast<tools::Long>( lcl_LineTotal(pBorderData->GetRight()) * nScaleX / 2 );
1317 nTop += static_cast<tools::Long>( lcl_LineTotal(pBorderData->GetTop()) * nScaleY / 2 );
1318 nBottom += static_cast<tools::Long>( lcl_LineTotal(pBorderData->GetBottom()) * nScaleY / 2 );
1319 }
1320 tools::Long nEffHeight = nScrH - nTop - nBottom;
1321 tools::Long nEffWidth = nScrW - nLeft - nRight;
1322 if (nEffHeight<=0 || nEffWidth<=0)
1323 return; // empty
1324
1325 if ( pBackground )
1326 {
1327 if (pBackground->GetGraphicPos() != GPOS_NONE)
1328 {
1329 OutputDevice* pRefDev;
1330 if ( bIsRender )
1331 pRefDev = pDev; // don't use printer for PDF
1332 else
1333 pRefDev = rDoc.GetPrinter(); // use printer also for preview
1334 OUString referer;
1335 if (pDocShell->HasName()) {
1336 referer = pDocShell->GetMedium()->GetName();
1337 }
1338 lcl_DrawGraphic(*pBackground, *pDev, pRefDev, aFrameRect, aFrameRect, referer);
1339 }
1340 else
1341 {
1342 pDev->SetFillColor(pBackground->GetColor());
1343 pDev->SetLineColor();
1344 pDev->DrawRect(aFrameRect);
1345 }
1346 }
1347
1348 if ( pShadow && pShadow->GetLocation() != SvxShadowLocation::NONE )
1349 {
1350 pDev->SetFillColor(pShadow->GetColor());
1351 pDev->SetLineColor();
1352 tools::Long nShadowX = static_cast<tools::Long>( pShadow->GetWidth() * nScaleX );
1353 tools::Long nShadowY = static_cast<tools::Long>( pShadow->GetWidth() * nScaleY );
1354 switch (pShadow->GetLocation())
1355 {
1356 case SvxShadowLocation::TopLeft:
1357 pDev->DrawRect( tools::Rectangle(
1358 aFrameRect.Left()-nShadowX, aFrameRect.Top()-nShadowY,
1359 aFrameRect.Right()-nShadowX, aFrameRect.Top() ) );
1360 pDev->DrawRect( tools::Rectangle(
1361 aFrameRect.Left()-nShadowX, aFrameRect.Top()-nShadowY,
1362 aFrameRect.Left(), aFrameRect.Bottom()-nShadowY ) );
1363 break;
1364 case SvxShadowLocation::TopRight:
1365 pDev->DrawRect( tools::Rectangle(
1366 aFrameRect.Left()+nShadowX, aFrameRect.Top()-nShadowY,
1367 aFrameRect.Right()+nShadowX, aFrameRect.Top() ) );
1368 pDev->DrawRect( tools::Rectangle(
1369 aFrameRect.Right(), aFrameRect.Top()-nShadowY,
1370 aFrameRect.Right()+nShadowX, aFrameRect.Bottom()-nShadowY ) );
1371 break;
1372 case SvxShadowLocation::BottomLeft:
1373 pDev->DrawRect( tools::Rectangle(
1374 aFrameRect.Left()-nShadowX, aFrameRect.Bottom(),
1375 aFrameRect.Right()-nShadowX, aFrameRect.Bottom()+nShadowY ) );
1376 pDev->DrawRect( tools::Rectangle(
1377 aFrameRect.Left()-nShadowX, aFrameRect.Top()+nShadowY,
1378 aFrameRect.Left(), aFrameRect.Bottom()+nShadowY ) );
1379 break;
1380 case SvxShadowLocation::BottomRight:
1381 pDev->DrawRect( tools::Rectangle(
1382 aFrameRect.Left()+nShadowX, aFrameRect.Bottom(),
1383 aFrameRect.Right()+nShadowX, aFrameRect.Bottom()+nShadowY ) );
1384 pDev->DrawRect( tools::Rectangle(
1385 aFrameRect.Right(), aFrameRect.Top()+nShadowY,
1386 aFrameRect.Right()+nShadowX, aFrameRect.Bottom()+nShadowY ) );
1387 break;
1388 default:
1389 {
1390 // added to avoid warnings
1391 }
1392 }
1393 }
1394
1395 if (!pBorderData)
1396 return;
1397
1399 pBorderDoc->InitUndo( rDoc, 0,0, true,true );
1400 pBorderDoc->ApplyAttr( 0,0,0, *pBorderData );
1401
1402 ScTableInfo aTabInfo;
1403 pBorderDoc->FillInfo( aTabInfo, 0,0, 0,0, 0,
1404 nScaleX, nScaleY, false, false );
1405 OSL_ENSURE(aTabInfo.mnArrCount,"nArrCount == 0");
1406
1407 aTabInfo.mpRowInfo[1].nHeight = static_cast<sal_uInt16>(nEffHeight);
1408 aTabInfo.mpRowInfo[0].basicCellInfo(0).nWidth =
1409 aTabInfo.mpRowInfo[1].basicCellInfo(0).nWidth = static_cast<sal_uInt16>(nEffWidth);
1410
1411 ScOutputData aOutputData( pDev, OUTTYPE_PRINTER, aTabInfo, pBorderDoc.get(), 0,
1412 nScrX+nLeft, nScrY+nTop, 0,0, 0,0, nScaleX, nScaleY );
1413 aOutputData.SetUseStyleColor( bUseStyleColor );
1414
1415 aOutputData.DrawFrame(*pDev);
1416}
1417
1419{
1420 bool bLayoutRTL = rDoc.IsLayoutRTL( nPrintTab );
1421 tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
1422
1423 Size aOnePixel = pDev->PixelToLogic(Size(1,1));
1424 tools::Long nOneX = aOnePixel.Width();
1425 tools::Long nOneY = aOnePixel.Height();
1426 SCCOL nCol;
1427
1428 tools::Long nHeight = static_cast<tools::Long>(PRINT_HEADER_HEIGHT * nScaleY);
1429 tools::Long nEndY = nScrY + nHeight - nOneY;
1430
1431 tools::Long nPosX = nScrX;
1432 if ( bLayoutRTL )
1433 {
1434 for (nCol=nX1; nCol<=nX2; nCol++)
1435 nPosX += static_cast<tools::Long>( rDoc.GetColWidth( nCol, nPrintTab ) * nScaleX );
1436 }
1437 else
1438 nPosX -= nOneX;
1439 tools::Long nPosY = nScrY - nOneY;
1440 OUString aText;
1441
1442 for (nCol=nX1; nCol<=nX2; nCol++)
1443 {
1444 sal_uInt16 nDocW = rDoc.GetColWidth( nCol, nPrintTab );
1445 if (nDocW)
1446 {
1447 tools::Long nWidth = static_cast<tools::Long>(nDocW * nScaleX);
1448 tools::Long nEndX = nPosX + nWidth * nLayoutSign;
1449
1450 pDev->DrawRect( tools::Rectangle( nPosX,nPosY,nEndX,nEndY ) );
1451
1452 aText = ::ScColToAlpha( nCol);
1453 tools::Long nTextWidth = pDev->GetTextWidth(aText);
1454 tools::Long nTextHeight = pDev->GetTextHeight();
1455 tools::Long nAddX = ( nWidth - nTextWidth ) / 2;
1456 tools::Long nAddY = ( nHeight - nTextHeight ) / 2;
1457 tools::Long nTextPosX = nPosX+nAddX;
1458 if ( bLayoutRTL )
1459 nTextPosX -= nWidth;
1460 pDev->DrawText( Point( nTextPosX,nPosY+nAddY ), aText );
1461
1462 nPosX = nEndX;
1463 }
1464 }
1465}
1466
1468{
1469 Size aOnePixel = pDev->PixelToLogic(Size(1,1));
1470 tools::Long nOneX = aOnePixel.Width();
1471 tools::Long nOneY = aOnePixel.Height();
1472
1473 bool bLayoutRTL = rDoc.IsLayoutRTL( nPrintTab );
1474
1475 tools::Long nWidth = static_cast<tools::Long>(PRINT_HEADER_WIDTH * nScaleX);
1476 tools::Long nEndX = nScrX + nWidth;
1477 tools::Long nPosX = nScrX;
1478 if ( !bLayoutRTL )
1479 {
1480 nEndX -= nOneX;
1481 nPosX -= nOneX;
1482 }
1483 tools::Long nPosY = nScrY - nOneY;
1484 OUString aText;
1485
1486 for (SCROW nRow=nY1; nRow<=nY2; nRow++)
1487 {
1488 sal_uInt16 nDocH = rDoc.GetRowHeight( nRow, nPrintTab );
1489 if (nDocH)
1490 {
1491 tools::Long nHeight = static_cast<tools::Long>(nDocH * nScaleY);
1492 tools::Long nEndY = nPosY + nHeight;
1493
1494 pDev->DrawRect( tools::Rectangle( nPosX,nPosY,nEndX,nEndY ) );
1495
1496 aText = OUString::number( nRow+1 );
1497 tools::Long nTextWidth = pDev->GetTextWidth(aText);
1498 tools::Long nTextHeight = pDev->GetTextHeight();
1499 tools::Long nAddX = ( nWidth - nTextWidth ) / 2;
1500 tools::Long nAddY = ( nHeight - nTextHeight ) / 2;
1501 pDev->DrawText( Point( nPosX+nAddX,nPosY+nAddY ), aText );
1502
1503 nPosY = nEndY;
1504 }
1505 }
1506}
1507
1509 bool bRepCol, ScPreviewLocationData& rLocationData )
1510{
1511 Size aOnePixel = pDev->PixelToLogic(Size(1,1));
1512 tools::Long nOneX = aOnePixel.Width();
1513 tools::Long nOneY = aOnePixel.Height();
1514
1515 tools::Long nHeight = static_cast<tools::Long>(PRINT_HEADER_HEIGHT * nScaleY);
1516 tools::Long nEndY = nScrY + nHeight - nOneY;
1517
1518 tools::Long nPosX = nScrX - nOneX;
1519 for (SCCOL nCol=nX1; nCol<=nX2; nCol++)
1520 {
1521 sal_uInt16 nDocW = rDoc.GetColWidth( nCol, nPrintTab );
1522 if (nDocW)
1523 nPosX += static_cast<tools::Long>(nDocW * nScaleX);
1524 }
1525 tools::Rectangle aCellRect( nScrX, nScrY, nPosX, nEndY );
1526 rLocationData.AddColHeaders( aCellRect, nX1, nX2, bRepCol );
1527}
1528
1530 bool bRepRow, ScPreviewLocationData& rLocationData )
1531{
1532 Size aOnePixel = pDev->PixelToLogic(Size(1,1));
1533 tools::Long nOneX = aOnePixel.Width();
1534 tools::Long nOneY = aOnePixel.Height();
1535
1536 bool bLayoutRTL = rDoc.IsLayoutRTL( nPrintTab );
1537
1538 tools::Long nWidth = static_cast<tools::Long>(PRINT_HEADER_WIDTH * nScaleX);
1539 tools::Long nEndX = nScrX + nWidth;
1540 if ( !bLayoutRTL )
1541 nEndX -= nOneX;
1542
1543 tools::Long nPosY = nScrY - nOneY;
1544 nPosY += rDoc.GetScaledRowHeight( nY1, nY2, nPrintTab, nScaleY);
1545 tools::Rectangle aCellRect( nScrX, nScrY, nEndX, nPosY );
1546 rLocationData.AddRowHeaders( aCellRect, nY1, nY2, bRepRow );
1547}
1548
1550 tools::Long nScrX, tools::Long nScrY, bool bRepCol, bool bRepRow,
1551 ScPreviewLocationData& rLocationData )
1552{
1553 // get MapMode for drawing objects (same MapMode as in ScOutputData::PrintDrawingLayer)
1554
1556 tools::Long nLogStX = aLogPos.X();
1557 tools::Long nLogStY = aLogPos.Y();
1558
1559 SCCOL nCol;
1560 Point aTwipOffset;
1561 for (nCol=0; nCol<nX1; nCol++)
1562 aTwipOffset.AdjustX( -(rDoc.GetColWidth( nCol, nPrintTab )) );
1563 aTwipOffset.AdjustY( -sal_Int32(rDoc.GetRowHeight( 0, nY1-1, nPrintTab )) );
1564
1566 aMMOffset += Point( nLogStX, nLogStY );
1567 MapMode aDrawMapMode( MapUnit::Map100thMM, aMMOffset, aLogicMode.GetScaleX(), aLogicMode.GetScaleY() );
1568
1569 // get pixel rectangle
1570
1571 Size aOnePixel = pDev->PixelToLogic(Size(1,1));
1572 tools::Long nOneX = aOnePixel.Width();
1573 tools::Long nOneY = aOnePixel.Height();
1574
1575 tools::Long nPosX = nScrX - nOneX;
1576 for (nCol=nX1; nCol<=nX2; nCol++)
1577 {
1578 sal_uInt16 nDocW = rDoc.GetColWidth( nCol, nPrintTab );
1579 if (nDocW)
1580 nPosX += static_cast<tools::Long>(nDocW * nScaleX);
1581 }
1582
1583 tools::Long nPosY = nScrY - nOneY;
1584 nPosY += rDoc.GetScaledRowHeight( nY1, nY2, nPrintTab, nScaleY);
1585 tools::Rectangle aCellRect( nScrX, nScrY, nPosX, nPosY );
1586 rLocationData.AddCellRange( aCellRect, ScRange( nX1,nY1,nPrintTab, nX2,nY2,nPrintTab ),
1587 bRepCol, bRepRow, aDrawMapMode );
1588}
1589
1591 tools::Long nScrX, tools::Long nScrY,
1592 bool bShLeft, bool bShTop, bool bShRight, bool bShBottom )
1593{
1594 // #i47547# nothing to do if the end of the print area is before the end of
1595 // the repeat columns/rows (don't use negative size for ScOutputData)
1596 if ( nX2 < nX1 || nY2 < nY1 )
1597 return;
1598
1600 ScRange aERange;
1601 bool bEmbed = rDoc.IsEmbedded();
1602 if (bEmbed)
1603 {
1604 rDoc.GetEmbedded(aERange);
1606 }
1607
1609 tools::Long nLogStX = aPos.X();
1610 tools::Long nLogStY = aPos.Y();
1611
1612 // Assemble data
1613
1614 ScTableInfo aTabInfo;
1615 rDoc.FillInfo( aTabInfo, nX1, nY1, nX2, nY2, nPrintTab,
1617 lcl_HidePrint( aTabInfo, nX1, nX2 );
1618
1619 if (bEmbed)
1620 rDoc.SetEmbedded(aERange);
1621
1622 ScOutputData aOutputData( pDev, OUTTYPE_PRINTER, aTabInfo, &rDoc, nPrintTab,
1623 nScrX, nScrY, nX1, nY1, nX2, nY2, nScaleX, nScaleY );
1624
1625 aOutputData.SetDrawView( pDrawView );
1626
1627 // test if all paint parts are hidden, then a paint is not necessary at all
1628 const Point aMMOffset(aOutputData.PrePrintDrawingLayer(nLogStX, nLogStY));
1629 const bool bHideAllDrawingLayer( pDrawView && pDrawView->getHideOle() && pDrawView->getHideChart()
1631
1632 if(!bHideAllDrawingLayer)
1633 {
1634 pDev->SetMapMode(aLogicMode);
1635 // don's set Clipping here (Mapmode is being moved)
1636
1637 // #i72502#
1638 aOutputData.PrintDrawingLayer(SC_LAYER_BACK, aMMOffset);
1639 }
1640
1641 pDev->SetMapMode(aOffsetMode);
1642
1643 aOutputData.SetShowFormulas( aTableParam.bFormulas );
1645 aOutputData.SetUseStyleColor( bUseStyleColor );
1646
1647 Color aGridColor( COL_BLACK );
1648 if ( bUseStyleColor )
1649 aGridColor = SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor;
1650 aOutputData.SetGridColor( aGridColor );
1651
1652 if ( !pPrinter )
1653 {
1654 OutputDevice* pRefDev = rDoc.GetPrinter(); // use the printer also for Preview
1655 Fraction aPrintFrac( nZoom, 100 ); // without nManualZoom
1656 // MapMode, as it would arrive at the printer:
1657 pRefDev->SetMapMode( MapMode( MapUnit::Map100thMM, Point(), aPrintFrac, aPrintFrac ) );
1658
1659 // when rendering (PDF), don't use printer as ref device, but printer's MapMode
1660 // has to be set anyway, as charts still use it (#106409#)
1661 if ( !bIsRender )
1662 aOutputData.SetRefDevice( pRefDev );
1663 }
1664
1666 aOutputData.DrawBackground(*pDev);
1667
1668 pDev->SetClipRegion(vcl::Region(tools::Rectangle(
1669 aPos, Size(aOutputData.GetScrW(), aOutputData.GetScrH()))));
1670 pDev->SetClipRegion();
1671
1673 {
1674 aOutputData.DrawExtraShadow( bShLeft, bShTop, bShRight, bShBottom );
1675 aOutputData.DrawFrame(*pDev);
1676 aOutputData.DrawSparklines(*pDev);
1677 aOutputData.DrawStrings();
1678 aOutputData.DrawEdit(false);
1679 }
1680
1681 if (aTableParam.bGrid)
1682 aOutputData.DrawGrid(*pDev, true, false); // no page breaks
1683
1684 aOutputData.AddPDFNotes(); // has no effect if not rendering PDF with notes enabled
1685
1686 // test if all paint parts are hidden, then a paint is not necessary at all
1687 if(!bHideAllDrawingLayer)
1688 {
1689 // #i72502#
1690 aOutputData.PrintDrawingLayer(SC_LAYER_FRONT, aMMOffset);
1691 }
1692
1693 // #i72502#
1694 aOutputData.PrintDrawingLayer(SC_LAYER_INTERN, aMMOffset);
1695 aOutputData.PostPrintDrawingLayer(aMMOffset); // #i74768#
1696}
1697
1698bool ScPrintFunc::IsMirror( tools::Long nPageNo ) // Mirror margins?
1699{
1700 return nPageUsage == SvxPageUsage::Mirror && (nPageNo & 1);
1701}
1702
1703bool ScPrintFunc::IsLeft( tools::Long nPageNo ) // left foot notes?
1704{
1705 bool bLeft;
1706 if (nPageUsage == SvxPageUsage::Left)
1707 bLeft = true;
1708 else if (nPageUsage == SvxPageUsage::Right)
1709 bLeft = false;
1710 else
1711 bLeft = (nPageNo & 1) != 0;
1712 return bLeft;
1713}
1714
1716{
1717 OUString aTmp;
1718 rDoc.GetName(nPrintTab, aTmp);
1719 aFieldData.aTabName = aTmp;
1720}
1721
1723{
1724 if (!pEditEngine)
1725 {
1726 // can't use document's edit engine pool here,
1727 // because pool must have twips as default metric
1729
1730 pEditEngine->EnableUndo(false);
1731 //fdo#45869 we want text to be positioned as it would be for the
1732 //high dpi printed output, not as would be ideal for the 96dpi preview
1733 //window itself
1734 pEditEngine->SetRefDevice(pPrinter ? pPrinter : rDoc.GetRefDevice());
1735 pEditEngine->SetWordDelimiters(
1736 ScEditUtil::ModifyDelimiters( pEditEngine->GetWordDelimiters() ) );
1737 pEditEngine->SetControlWord( pEditEngine->GetControlWord() & ~EEControlBits::RTFSTYLESHEETS );
1739 pEditEngine->EnableAutoColor( bUseStyleColor );
1740
1741 // Default-Set for alignment
1742 pEditDefaults.reset( new SfxItemSet( pEditEngine->GetEmptyItemSet() ) );
1743
1745 rPattern.FillEditItemSet( pEditDefaults.get() );
1746 // FillEditItemSet adjusts font height to 1/100th mm,
1747 // but for header/footer twips is needed, as in the PatternAttr:
1751 // don't use font color, because background color is not used
1753 pEditDefaults->ClearItem( EE_CHAR_COLOR );
1755 pEditDefaults->Put( SvxFrameDirectionItem( SvxFrameDirection::Horizontal_RL_TB, EE_PARA_WRITINGDIR ) );
1756 }
1757
1758 pEditEngine->SetData( aFieldData ); // Set page count etc.
1759}
1760
1761// nStartY = logic
1762void ScPrintFunc::PrintHF( tools::Long nPageNo, bool bHeader, tools::Long nStartY,
1763 bool bDoPrint, ScPreviewLocationData* pLocationData )
1764{
1765 const ScPrintHFParam& rParam = bHeader ? aHdr : aFtr;
1766
1767 pDev->SetMapMode( aTwipMode ); // Head-/Footlines in Twips
1768
1769 bool bFirst = 0 == nPageNo && !rParam.bSharedFirst;
1770 bool bLeft = IsLeft(nPageNo) && !rParam.bShared;
1771 const ScPageHFItem* pHFItem = bFirst ? rParam.pFirst : (bLeft ? rParam.pLeft : rParam.pRight);
1772
1773 tools::Long nLineStartX = aPageRect.Left() + rParam.nLeft;
1774 tools::Long nLineEndX = aPageRect.Right() - rParam.nRight;
1775 tools::Long nLineWidth = nLineEndX - nLineStartX + 1;
1776
1777 // Edit-Engine
1778
1779 Point aStart( nLineStartX, nStartY );
1780 Size aPaperSize( nLineWidth, rParam.nHeight-rParam.nDistance );
1781 if ( rParam.pBorder )
1782 {
1783 tools::Long nLeft = lcl_LineTotal( rParam.pBorder->GetLeft() ) + rParam.pBorder->GetDistance(SvxBoxItemLine::LEFT);
1784 tools::Long nTop = lcl_LineTotal( rParam.pBorder->GetTop() ) + rParam.pBorder->GetDistance(SvxBoxItemLine::TOP);
1785 aStart.AdjustX(nLeft );
1786 aStart.AdjustY(nTop );
1787 aPaperSize.AdjustWidth( -(nLeft + lcl_LineTotal( rParam.pBorder->GetRight() ) + rParam.pBorder->GetDistance(SvxBoxItemLine::RIGHT)) );
1788 aPaperSize.AdjustHeight( -(nTop + lcl_LineTotal( rParam.pBorder->GetBottom() ) + rParam.pBorder->GetDistance(SvxBoxItemLine::BOTTOM)) );
1789 }
1790
1791 if ( rParam.pShadow && rParam.pShadow->GetLocation() != SvxShadowLocation::NONE )
1792 {
1793 tools::Long nLeft = rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::LEFT);
1794 tools::Long nTop = rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::TOP);
1795 aStart.AdjustX(nLeft );
1796 aStart.AdjustY(nTop );
1797 aPaperSize.AdjustWidth( -(nLeft + rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::RIGHT)) );
1798 aPaperSize.AdjustHeight( -(nTop + rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::BOTTOM)) );
1799 }
1800
1803
1804 pEditEngine->SetPaperSize(aPaperSize);
1805
1806 // Frame / Background
1807
1808 Point aBorderStart( nLineStartX, nStartY );
1809 Size aBorderSize( nLineWidth, rParam.nHeight-rParam.nDistance );
1810 if ( rParam.bDynamic )
1811 {
1812 // adjust here again, for even/odd head-/footlines
1813 // and probably other breaks by variable (page number etc.)
1814
1815 tools::Long nMaxHeight = 0;
1816 nMaxHeight = std::max( nMaxHeight, TextHeight( pHFItem->GetLeftArea() ) );
1817 nMaxHeight = std::max( nMaxHeight, TextHeight( pHFItem->GetCenterArea() ) );
1818 nMaxHeight = std::max( nMaxHeight, TextHeight( pHFItem->GetRightArea() ) );
1819 if (rParam.pBorder)
1820 nMaxHeight += lcl_LineTotal( rParam.pBorder->GetTop() ) +
1821 lcl_LineTotal( rParam.pBorder->GetBottom() ) +
1822 rParam.pBorder->GetDistance(SvxBoxItemLine::TOP) +
1823 rParam.pBorder->GetDistance(SvxBoxItemLine::BOTTOM);
1824 if (rParam.pShadow && rParam.pShadow->GetLocation() != SvxShadowLocation::NONE)
1825 nMaxHeight += rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::TOP) +
1826 rParam.pShadow->CalcShadowSpace(SvxShadowItemSide::BOTTOM);
1827
1828 if (nMaxHeight < rParam.nManHeight-rParam.nDistance)
1829 nMaxHeight = rParam.nManHeight-rParam.nDistance; // configured Minimum
1830
1831 aBorderSize.setHeight( nMaxHeight );
1832 }
1833
1834 if ( bDoPrint )
1835 {
1836 double nOldScaleX = nScaleX;
1837 double nOldScaleY = nScaleY;
1838 nScaleX = nScaleY = 1.0; // output directly in Twips
1839 DrawBorder( aBorderStart.X(), aBorderStart.Y(), aBorderSize.Width(), aBorderSize.Height(),
1840 rParam.pBorder, rParam.pBack, rParam.pShadow );
1841 nScaleX = nOldScaleX;
1842 nScaleY = nOldScaleY;
1843
1844 // Clipping for Text
1845
1846 pDev->SetClipRegion(vcl::Region(tools::Rectangle(aStart, aPaperSize)));
1847
1848 // left
1849
1850 const EditTextObject* pObject = pHFItem->GetLeftArea();
1851 if (pObject)
1852 {
1853 pEditDefaults->Put( SvxAdjustItem( SvxAdjust::Left, EE_PARA_JUST ) );
1854 pEditEngine->SetTextNewDefaults( *pObject, *pEditDefaults, false );
1855 Point aDraw = aStart;
1856 tools::Long nDif = aPaperSize.Height() - static_cast<tools::Long>(pEditEngine->GetTextHeight());
1857 if (nDif > 0)
1858 aDraw.AdjustY(nDif / 2 );
1859 pEditEngine->Draw(*pDev, aDraw);
1860 }
1861
1862 // center
1863
1864 pObject = pHFItem->GetCenterArea();
1865 if (pObject)
1866 {
1867 pEditDefaults->Put( SvxAdjustItem( SvxAdjust::Center, EE_PARA_JUST ) );
1868 pEditEngine->SetTextNewDefaults( *pObject, *pEditDefaults, false );
1869 Point aDraw = aStart;
1870 tools::Long nDif = aPaperSize.Height() - static_cast<tools::Long>(pEditEngine->GetTextHeight());
1871 if (nDif > 0)
1872 aDraw.AdjustY(nDif / 2 );
1873 pEditEngine->Draw(*pDev, aDraw);
1874 }
1875
1876 // right
1877
1878 pObject = pHFItem->GetRightArea();
1879 if (pObject)
1880 {
1881 pEditDefaults->Put( SvxAdjustItem( SvxAdjust::Right, EE_PARA_JUST ) );
1882 pEditEngine->SetTextNewDefaults( *pObject, *pEditDefaults, false );
1883 Point aDraw = aStart;
1884 tools::Long nDif = aPaperSize.Height() - static_cast<tools::Long>(pEditEngine->GetTextHeight());
1885 if (nDif > 0)
1886 aDraw.AdjustY(nDif / 2 );
1887 pEditEngine->Draw(*pDev, aDraw);
1888 }
1889
1890 pDev->SetClipRegion();
1891 }
1892
1893 if ( pLocationData )
1894 {
1895 tools::Rectangle aHeaderRect( aBorderStart, aBorderSize );
1896 pLocationData->AddHeaderFooter( aHeaderRect, bHeader, bLeft );
1897 }
1898}
1899
1900tools::Long ScPrintFunc::DoNotes( tools::Long nNoteStart, bool bDoPrint, ScPreviewLocationData* pLocationData )
1901{
1902 if (bDoPrint)
1903 pDev->SetMapMode(aTwipMode);
1904
1906 pEditDefaults->Put( SvxAdjustItem( SvxAdjust::Left, EE_PARA_JUST ) );
1907 pEditEngine->SetDefaults( *pEditDefaults );
1908
1909 vcl::Font aMarkFont;
1911 rDoc.GetPool()->GetDefaultItem(ATTR_PATTERN).fillFont(aMarkFont, eColorMode);
1912 pDev->SetFont(aMarkFont);
1913 tools::Long nMarkLen = pDev->GetTextWidth("GW99999:");
1914 // without Space-Char, because it rarely arrives there
1915
1916 Size aDataSize = aPageRect.GetSize();
1917 if ( nMarkLen > aDataSize.Width() / 2 ) // everything much too small?
1918 nMarkLen = aDataSize.Width() / 2; // split the page appropriately
1919 aDataSize.AdjustWidth( -nMarkLen );
1920
1921 pEditEngine->SetPaperSize( aDataSize );
1922 tools::Long nPosX = aPageRect.Left() + nMarkLen;
1923 tools::Long nPosY = aPageRect.Top();
1924
1925 tools::Long nCount = 0;
1926 tools::Long nSize = aNotePosList.size();
1927 bool bOk;
1928 do
1929 {
1930 bOk = false;
1931 if ( nNoteStart + nCount < nSize)
1932 {
1933 ScAddress &rPos = aNotePosList[ nNoteStart + nCount ];
1934
1935 if( const ScPostIt* pNote = rDoc.GetNote( rPos ) )
1936 {
1937 if(const EditTextObject *pEditText = pNote->GetEditTextObject())
1938 pEditEngine->SetTextCurrentDefaults(*pEditText);
1939 tools::Long nTextHeight = pEditEngine->GetTextHeight();
1940 if ( nPosY + nTextHeight < aPageRect.Bottom() )
1941 {
1942 if (bDoPrint)
1943 {
1944 pEditEngine->Draw(*pDev, Point(nPosX, nPosY));
1945
1946 OUString aMarkStr(rPos.Format(ScRefFlags::VALID, &rDoc, rDoc.GetAddressConvention()) + ":");
1947
1948 // cell position also via EditEngine, for correct positioning
1949 pEditEngine->SetTextCurrentDefaults(aMarkStr);
1950 pEditEngine->Draw(*pDev, Point(aPageRect.Left(), nPosY));
1951 }
1952
1953 if ( pLocationData )
1954 {
1955 tools::Rectangle aTextRect( Point( nPosX, nPosY ), Size( aDataSize.Width(), nTextHeight ) );
1956 pLocationData->AddNoteText( aTextRect, rPos );
1957 tools::Rectangle aMarkRect( Point( aPageRect.Left(), nPosY ), Size( nMarkLen, nTextHeight ) );
1958 pLocationData->AddNoteMark( aMarkRect, rPos );
1959 }
1960
1961 nPosY += nTextHeight;
1962 nPosY += 200; // Distance
1963 ++nCount;
1964 bOk = true;
1965 }
1966 }
1967 }
1968 }
1969 while (bOk);
1970
1971 return nCount;
1972}
1973
1974tools::Long ScPrintFunc::PrintNotes( tools::Long nPageNo, tools::Long nNoteStart, bool bDoPrint, ScPreviewLocationData* pLocationData )
1975{
1976 if ( nNoteStart >= static_cast<tools::Long>(aNotePosList.size()) || !aTableParam.bNotes )
1977 return 0;
1978
1979 if ( bDoPrint && bClearWin )
1980 {
1982
1983 Color aBackgroundColor( COL_WHITE );
1984 if ( bUseStyleColor )
1985 aBackgroundColor = SC_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
1986
1987 pDev->SetMapMode(aOffsetMode);
1988 pDev->SetLineColor();
1989 pDev->SetFillColor(aBackgroundColor);
1990 pDev->DrawRect(tools::Rectangle(Point(),
1991 Size(static_cast<tools::Long>(aPageSize.Width() * nScaleX * 100 / nZoom),
1992 static_cast<tools::Long>(aPageSize.Height() * nScaleY * 100 / nZoom))));
1993 }
1994
1995 // adjust aPageRect for left/right page
1996
1997 tools::Rectangle aTempRect( Point(), aPageSize );
1998 if (IsMirror(nPageNo))
1999 {
2000 aPageRect.SetLeft( ( aTempRect.Left() + nRightMargin ) * 100 / nZoom );
2001 aPageRect.SetRight( ( aTempRect.Right() - nLeftMargin ) * 100 / nZoom );
2002 }
2003 else
2004 {
2005 aPageRect.SetLeft( ( aTempRect.Left() + nLeftMargin ) * 100 / nZoom );
2006 aPageRect.SetRight( ( aTempRect.Right() - nRightMargin ) * 100 / nZoom );
2007 }
2008
2009 if ( pPrinter && bDoPrint )
2010 {
2011 OSL_FAIL( "StartPage does not exist anymore" );
2012 }
2013
2014 if ( bDoPrint || pLocationData )
2015 {
2016 // Head and foot lines
2017
2018 if (aHdr.bEnable)
2019 {
2020 tools::Long nHeaderY = aPageRect.Top()-aHdr.nHeight;
2021 PrintHF( nPageNo, true, nHeaderY, bDoPrint, pLocationData );
2022 }
2023 if (aFtr.bEnable)
2024 {
2026 PrintHF( nPageNo, false, nFooterY, bDoPrint, pLocationData );
2027 }
2028 }
2029
2030 tools::Long nCount = DoNotes( nNoteStart, bDoPrint, pLocationData );
2031
2032 if ( pPrinter && bDoPrint )
2033 {
2034 OSL_FAIL( "EndPage does not exist anymore" );
2035 }
2036
2037 return nCount;
2038}
2039
2040void ScPrintFunc::PrintPage( tools::Long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
2041 bool bDoPrint, ScPreviewLocationData* pLocationData )
2042{
2043 bool bLayoutRTL = rDoc.IsLayoutRTL( nPrintTab );
2044 tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
2045
2046 // nPageNo is the page number within all sheets of one "start page" setting
2047
2048 if ( bClearWin && bDoPrint )
2049 {
2050 // must exactly fit to painting the frame in preview.cxx !!!
2051
2052 Color aBackgroundColor( COL_WHITE );
2053 if ( bUseStyleColor )
2054 aBackgroundColor = SC_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
2055
2056 pDev->SetMapMode(aOffsetMode);
2057 pDev->SetLineColor();
2058 pDev->SetFillColor(aBackgroundColor);
2059 pDev->DrawRect(tools::Rectangle(Point(),
2060 Size(static_cast<tools::Long>(aPageSize.Width() * nScaleX * 100 / nZoom),
2061 static_cast<tools::Long>(aPageSize.Height() * nScaleY * 100 / nZoom))));
2062 }
2063
2064 // adjust aPageRect for left/right page
2065
2066 tools::Rectangle aTempRect( Point(), aPageSize );
2067 if (IsMirror(nPageNo))
2068 {
2069 aPageRect.SetLeft( ( aTempRect.Left() + nRightMargin ) * 100 / nZoom );
2070 aPageRect.SetRight( ( aTempRect.Right() - nLeftMargin ) * 100 / nZoom );
2071 }
2072 else
2073 {
2074 aPageRect.SetLeft( ( aTempRect.Left() + nLeftMargin ) * 100 / nZoom );
2075 aPageRect.SetRight( ( aTempRect.Right() - nRightMargin ) * 100 / nZoom );
2076 }
2077
2078 if ( aAreaParam.bRepeatCol )
2079 if ( nX1 > nRepeatStartCol && nX1 <= nRepeatEndCol )
2080 nX1 = nRepeatEndCol + 1;
2081 bool bDoRepCol = (aAreaParam.bRepeatCol && nX1 > nRepeatEndCol);
2082 if ( aAreaParam.bRepeatRow )
2083 if ( nY1 > nRepeatStartRow && nY1 <= nRepeatEndRow )
2084 nY1 = nRepeatEndRow + 1;
2085 bool bDoRepRow = (aAreaParam.bRepeatRow && nY1 > nRepeatEndRow);
2086
2087 // use new object hide flags in SdrPaintView
2088 if(pDrawView)
2089 {
2094 }
2095
2096 if ( pPrinter && bDoPrint )
2097 {
2098 OSL_FAIL( "StartPage does not exist anymore" );
2099 }
2100
2101 // head and foot lines (without centering)
2102
2103 if (aHdr.bEnable)
2104 {
2105 tools::Long nHeaderY = aPageRect.Top()-aHdr.nHeight;
2106 PrintHF( nPageNo, true, nHeaderY, bDoPrint, pLocationData );
2107 }
2108 if (aFtr.bEnable)
2109 {
2111 PrintHF( nPageNo, false, nFooterY, bDoPrint, pLocationData );
2112 }
2113
2114 // Position ( margins / centering )
2115
2116 tools::Long nLeftSpace = aPageRect.Left(); // Document-Twips
2117 tools::Long nTopSpace = aPageRect.Top();
2118 if ( bCenterHor || bLayoutRTL )
2119 {
2120 tools::Long nDataWidth = 0;
2121 SCCOL i;
2122 for (i=nX1; i<=nX2; i++)
2123 nDataWidth += rDoc.GetColWidth( i,nPrintTab );
2124 if (bDoRepCol)
2125 for (i=nRepeatStartCol; i<=nRepeatEndCol; i++)
2126 nDataWidth += rDoc.GetColWidth( i,nPrintTab );
2128 nDataWidth += tools::Long(PRINT_HEADER_WIDTH);
2129 if (pBorderItem)
2130 nDataWidth += pBorderItem->GetDistance(SvxBoxItemLine::LEFT) +
2131 pBorderItem->GetDistance(SvxBoxItemLine::RIGHT);
2132 if (pShadowItem && pShadowItem->GetLocation() != SvxShadowLocation::NONE)
2133 nDataWidth += pShadowItem->CalcShadowSpace(SvxShadowItemSide::LEFT) +
2134 pShadowItem->CalcShadowSpace(SvxShadowItemSide::RIGHT);
2135 if ( bCenterHor )
2136 {
2137 nLeftSpace += ( aPageRect.GetWidth() - nDataWidth ) / 2; // LTR or RTL
2138 if (pBorderItem)
2139 nLeftSpace -= lcl_LineTotal(pBorderItem->GetLeft());
2140 }
2141 else if ( bLayoutRTL )
2142 nLeftSpace += aPageRect.GetWidth() - nDataWidth; // align to the right edge of the page
2143 }
2144 if ( bCenterVer )
2145 {
2146 tools::Long nDataHeight = rDoc.GetRowHeight( nY1, nY2, nPrintTab);
2147 if (bDoRepRow)
2148 nDataHeight += rDoc.GetRowHeight( nRepeatStartRow,
2151 nDataHeight += tools::Long(PRINT_HEADER_HEIGHT);
2152 if (pBorderItem)
2153 nDataHeight += pBorderItem->GetDistance(SvxBoxItemLine::TOP) +
2154 pBorderItem->GetDistance(SvxBoxItemLine::BOTTOM);
2155 if (pShadowItem && pShadowItem->GetLocation() != SvxShadowLocation::NONE)
2156 nDataHeight += pShadowItem->CalcShadowSpace(SvxShadowItemSide::TOP) +
2157 pShadowItem->CalcShadowSpace(SvxShadowItemSide::BOTTOM);
2158 nTopSpace += ( aPageRect.GetHeight() - nDataHeight ) / 2;
2159 if (pBorderItem)
2160 nTopSpace -= lcl_LineTotal(pBorderItem->GetTop());
2161 }
2162
2163 // calculate sizes of the elements for partitioning
2164 // (header, repeat, data)
2165
2166 tools::Long nHeaderWidth = 0;
2167 tools::Long nHeaderHeight = 0;
2168 tools::Long nRepeatWidth = 0;
2169 tools::Long nRepeatHeight = 0;
2170 tools::Long nContentWidth = 0; // scaled - not the same as nDataWidth above
2171 tools::Long nContentHeight = 0;
2173 {
2174 nHeaderWidth = static_cast<tools::Long>(PRINT_HEADER_WIDTH * nScaleX);
2175 nHeaderHeight = static_cast<tools::Long>(PRINT_HEADER_HEIGHT * nScaleY);
2176 }
2177 if (bDoRepCol)
2179 nRepeatWidth += static_cast<tools::Long>(rDoc.GetColWidth(i,nPrintTab) * nScaleX);
2180 if (bDoRepRow)
2181 nRepeatHeight += rDoc.GetScaledRowHeight( nRepeatStartRow,
2183 for (SCCOL i=nX1; i<=nX2; i++)
2184 nContentWidth += static_cast<tools::Long>(rDoc.GetColWidth(i,nPrintTab) * nScaleX);
2185 nContentHeight += rDoc.GetScaledRowHeight( nY1, nY2, nPrintTab,
2186 nScaleY);
2187
2188 // partition the page
2189
2190 tools::Long nStartX = static_cast<tools::Long>( nLeftSpace * nScaleX );
2191 tools::Long nStartY = static_cast<tools::Long>( nTopSpace * nScaleY );
2192 tools::Long nInnerStartX = nStartX;
2193 tools::Long nInnerStartY = nStartY;
2194 if (pBorderItem)
2195 {
2196 nInnerStartX += static_cast<tools::Long>( ( lcl_LineTotal(pBorderItem->GetLeft()) +
2197 pBorderItem->GetDistance(SvxBoxItemLine::LEFT) ) * nScaleX );
2198 nInnerStartY += static_cast<tools::Long>( ( lcl_LineTotal(pBorderItem->GetTop()) +
2199 pBorderItem->GetDistance(SvxBoxItemLine::TOP) ) * nScaleY );
2200 }
2201 if (pShadowItem && pShadowItem->GetLocation() != SvxShadowLocation::NONE)
2202 {
2203 nInnerStartX += static_cast<tools::Long>( pShadowItem->CalcShadowSpace(SvxShadowItemSide::LEFT) * nScaleX );
2204 nInnerStartY += static_cast<tools::Long>( pShadowItem->CalcShadowSpace(SvxShadowItemSide::TOP) * nScaleY );
2205 }
2206
2207 if ( bLayoutRTL )
2208 {
2209 // arrange elements starting from the right edge
2210 nInnerStartX += nHeaderWidth + nRepeatWidth + nContentWidth;
2211
2212 // make rounding easier so the elements are really next to each other in preview
2213 Size aOffsetOnePixel = pDev->PixelToLogic( Size(1,1), aOffsetMode );
2214 tools::Long nOffsetOneX = aOffsetOnePixel.Width();
2215 nInnerStartX += nOffsetOneX / 2;
2216 }
2217
2218 tools::Long nFrameStartX = nInnerStartX;
2219 tools::Long nFrameStartY = nInnerStartY;
2220
2221 tools::Long nRepStartX = nInnerStartX + nHeaderWidth * nLayoutSign; // widths/heights are 0 if not used
2222 tools::Long nRepStartY = nInnerStartY + nHeaderHeight;
2223 tools::Long nDataX = nRepStartX + nRepeatWidth * nLayoutSign;
2224 tools::Long nDataY = nRepStartY + nRepeatHeight;
2225 tools::Long nEndX = nDataX + nContentWidth * nLayoutSign;
2226 tools::Long nEndY = nDataY + nContentHeight;
2227 tools::Long nFrameEndX = nEndX;
2228 tools::Long nFrameEndY = nEndY;
2229
2230 if ( bLayoutRTL )
2231 {
2232 // each element's start position is its left edge
2234 nInnerStartX -= nHeaderWidth; // used for header
2235 nRepStartX -= nRepeatWidth;
2236 nDataX -= nContentWidth;
2237
2238 // continue right of the main elements again
2239 nEndX += nHeaderWidth + nRepeatWidth + nContentWidth;
2240 }
2241
2242 // Page frame / background
2243
2245
2246 tools::Long nBorderEndX = nEndX;
2247 tools::Long nBorderEndY = nEndY;
2248 if (pBorderItem)
2249 {
2250 nBorderEndX += static_cast<tools::Long>( ( lcl_LineTotal(pBorderItem->GetRight()) +
2251 pBorderItem->GetDistance(SvxBoxItemLine::RIGHT) ) * nScaleX );
2252 nBorderEndY += static_cast<tools::Long>( ( lcl_LineTotal(pBorderItem->GetBottom()) +
2253 pBorderItem->GetDistance(SvxBoxItemLine::BOTTOM) ) * nScaleY );
2254 }
2255 if (pShadowItem && pShadowItem->GetLocation() != SvxShadowLocation::NONE)
2256 {
2257 nBorderEndX += static_cast<tools::Long>( pShadowItem->CalcShadowSpace(SvxShadowItemSide::RIGHT) * nScaleX );
2258 nBorderEndY += static_cast<tools::Long>( pShadowItem->CalcShadowSpace(SvxShadowItemSide::BOTTOM) * nScaleY );
2259 }
2260
2261 if ( bDoPrint )
2262 {
2263 pDev->SetMapMode( aOffsetMode );
2264 DrawBorder( nStartX, nStartY, nBorderEndX-nStartX, nBorderEndY-nStartY,
2266
2267 pDev->SetMapMode( aTwipMode );
2268 }
2269
2270 pDev->SetMapMode( aOffsetMode );
2271
2272 // Output repeating rows/columns
2273
2274 if (bDoRepCol && bDoRepRow)
2275 {
2276 if ( bDoPrint )
2278 nRepStartX,nRepStartY, true, true, false, false );
2279 if ( pLocationData )
2281 nRepStartX,nRepStartY, true, true, *pLocationData );
2282 }
2283 if (bDoRepCol)
2284 {
2285 if ( bDoPrint )
2286 PrintArea( nRepeatStartCol,nY1, nRepeatEndCol,nY2, nRepStartX,nDataY,
2287 true, !bDoRepRow, false, true );
2288 if ( pLocationData )
2289 LocateArea( nRepeatStartCol,nY1, nRepeatEndCol,nY2, nRepStartX,nDataY, true, false, *pLocationData );
2290 }
2291 if (bDoRepRow)
2292 {
2293 if ( bDoPrint )
2294 PrintArea( nX1,nRepeatStartRow, nX2,nRepeatEndRow, nDataX,nRepStartY,
2295 !bDoRepCol, true, true, false );
2296 if ( pLocationData )
2297 LocateArea( nX1,nRepeatStartRow, nX2,nRepeatEndRow, nDataX,nRepStartY, false, true, *pLocationData );
2298 }
2299
2300 // output data
2301
2302 if ( bDoPrint )
2303 PrintArea( nX1,nY1, nX2,nY2, nDataX,nDataY, !bDoRepCol,!bDoRepRow, true, true );
2304 if ( pLocationData )
2305 LocateArea( nX1,nY1, nX2,nY2, nDataX,nDataY, false,false, *pLocationData );
2306
2307 // output column/row headers
2308 // after data (through probably shadow)
2309
2310 Color aGridColor( COL_BLACK );
2311 if ( bUseStyleColor )
2312 aGridColor = SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor;
2313
2315 {
2316 if ( bDoPrint )
2317 {
2318 pDev->SetLineColor( aGridColor );
2319 pDev->SetFillColor();
2320 pDev->SetMapMode(aOffsetMode);
2321 }
2322
2323 ScPatternAttr aPattern( rDoc.GetPool() );
2324 vcl::Font aFont;
2326 aPattern.fillFont(aFont, eColorMode, pDev);
2327 pDev->SetFont(aFont);
2328
2329 if (bDoRepCol)
2330 {
2331 if ( bDoPrint )
2332 PrintColHdr( nRepeatStartCol,nRepeatEndCol, nRepStartX,nInnerStartY );
2333 if ( pLocationData )
2334 LocateColHdr( nRepeatStartCol,nRepeatEndCol, nRepStartX,nInnerStartY, true, *pLocationData );
2335 }
2336 if ( bDoPrint )
2337 PrintColHdr( nX1,nX2, nDataX,nInnerStartY );
2338 if ( pLocationData )
2339 LocateColHdr( nX1,nX2, nDataX,nInnerStartY, false, *pLocationData );
2340 if (bDoRepRow)
2341 {
2342 if ( bDoPrint )
2343 PrintRowHdr( nRepeatStartRow,nRepeatEndRow, nInnerStartX,nRepStartY );
2344 if ( pLocationData )
2345 LocateRowHdr( nRepeatStartRow,nRepeatEndRow, nInnerStartX,nRepStartY, true, *pLocationData );
2346 }
2347 if ( bDoPrint )
2348 PrintRowHdr( nY1,nY2, nInnerStartX,nDataY );
2349 if ( pLocationData )
2350 LocateRowHdr( nY1,nY2, nInnerStartX,nDataY, false, *pLocationData );
2351 }
2352
2353 // simple frame
2354
2355 if ( bDoPrint && ( aTableParam.bGrid || aTableParam.bHeaders ) )
2356 {
2357 Size aOnePixel = pDev->PixelToLogic(Size(1,1));
2358 tools::Long nOneX = aOnePixel.Width();
2359 tools::Long nOneY = aOnePixel.Height();
2360
2361 tools::Long nLeftX = nFrameStartX;
2362 tools::Long nTopY = nFrameStartY - nOneY;
2363 tools::Long nRightX = nFrameEndX;
2364 tools::Long nBottomY = nFrameEndY - nOneY;
2365 if ( !bLayoutRTL )
2366 {
2367 nLeftX -= nOneX;
2368 nRightX -= nOneX;
2369 }
2370 pDev->SetMapMode(aOffsetMode);
2371 pDev->SetLineColor( aGridColor );
2372 pDev->SetFillColor();
2373 pDev->DrawRect( tools::Rectangle( nLeftX, nTopY, nRightX, nBottomY ) );
2374 // nEndX/Y without frame-adaptation
2375 }
2376
2377 if ( pPrinter && bDoPrint )
2378 {
2379 OSL_FAIL( "EndPage does not exist anymore" );
2380 }
2381
2382 aLastSourceRange = ScRange( nX1, nY1, nPrintTab, nX2, nY2, nPrintTab );
2383 bSourceRangeValid = true;
2384}
2385
2387{
2388 aSrcOffset = rOfs;
2389}
2390
2391void ScPrintFunc::SetManualZoom( sal_uInt16 nNewZoom )
2392{
2393 nManualZoom = nNewZoom;
2394}
2395
2397{
2398 bClearWin = bFlag;
2399}
2400
2402{
2403 bUseStyleColor = bFlag;
2404 if (pEditEngine)
2405 pEditEngine->EnableAutoColor( bUseStyleColor );
2406}
2407
2409{
2410 bIsRender = bFlag; // set when using XRenderable (PDF)
2411}
2412
2414{
2415 aTableParam.bCellContent = false;
2416 aTableParam.bNotes = false;
2417 aTableParam.bGrid = false;
2418 aTableParam.bHeaders = false;
2419 aTableParam.bFormulas = false;
2420 aTableParam.bNullVals = false;
2421}
2422
2423// UpdatePages is only called from outside to set the breaks correctly for viewing
2424// - always without UserArea
2425
2427{
2428 if (!pParamSet)
2429 return false;
2430
2431 // Zoom
2432
2433 nZoom = 100;
2435 nZoom = ZOOM_MIN; // correct for breaks
2436 else if (aTableParam.bScaleAll)
2437 {
2439 if ( nZoom <= ZOOM_MIN )
2440 nZoom = ZOOM_MIN;
2441 }
2442
2443 OUString aName = rDoc.GetPageStyle( nPrintTab );
2444 SCTAB nTabCount = rDoc.GetTableCount();
2445 for (SCTAB nTab=0; nTab<nTabCount; nTab++)
2446 if ( nTab==nPrintTab || rDoc.GetPageStyle(nTab)==aName )
2447 {
2448 // Repeating rows/columns
2450
2451 // set breaks
2452 ResetBreaks(nTab);
2454 }
2455
2456 return true;
2457}
2458
2459tools::Long ScPrintFunc::CountPages() // sets also nPagesX, nPagesY
2460{
2461 bool bAreaOk = false;
2462
2463 if (rDoc.HasTable( nPrintTab ))
2464 {
2465 if (aAreaParam.bPrintArea) // Specify print area?
2466 {
2467 if ( bPrintCurrentTable )
2468 {
2469 ScRange& rRange = aAreaParam.aPrintArea;
2470
2471 // Here, no comparison of the tables any more. Area is always valid for this table
2472 // If comparison should be done here, the table of print ranges must be adjusted
2473 // when inserting tables etc.!
2474
2475 nStartCol = rRange.aStart.Col();
2476 nStartRow = rRange.aStart.Row();
2477 nEndCol = rRange.aEnd .Col();
2478 nEndRow = rRange.aEnd .Row();
2479 bAreaOk = AdjustPrintArea(false); // limit
2480 }
2481 else
2482 bAreaOk = false;
2483 }
2484 else // search from document
2485 bAreaOk = AdjustPrintArea(true);
2486 }
2487
2488 if (bAreaOk)
2489 {
2490 tools::Long nPages = 0;
2491 size_t nY;
2492 if (bMultiArea)
2493 {
2494 sal_uInt16 nRCount = rDoc.GetPrintRangeCount( nPrintTab );
2495 for (sal_uInt16 i=0; i<nRCount; i++)
2496 {
2497 CalcZoom(i);
2498 if ( aTableParam.bSkipEmpty )
2499 for (nY=0; nY< m_aRanges.m_nPagesY; nY++)
2500 nPages += (*m_aRanges.m_xPageRows)[nY].CountVisible();
2501 else
2502 nPages += static_cast<tools::Long>(m_aRanges.m_nPagesX) * m_aRanges.m_nPagesY;
2503 if ( pPageData )
2504 FillPageData();
2505 }
2506 }
2507 else
2508 {
2509 CalcZoom(RANGENO_NORANGE); // calculate Zoom
2510 if ( aTableParam.bSkipEmpty )
2511 for (nY=0; nY<m_aRanges.m_nPagesY; nY++)
2512 nPages += (*m_aRanges.m_xPageRows)[nY].CountVisible();
2513 else
2514 nPages += static_cast<tools::Long>(m_aRanges.m_nPagesX) * m_aRanges.m_nPagesY;
2515 if ( pPageData )
2516 FillPageData();
2517 }
2518 return nPages;
2519 }
2520 else
2521 {
2523 return 0;
2524 }
2525}
2526
2528{
2530 return 0;
2531
2532 bool bError = false;
2534 bError = !AdjustPrintArea(true); // completely search in Doc
2535
2536 sal_uInt16 nRepeats = 1; // how often go through it ?
2537 if (bMultiArea)
2538 nRepeats = rDoc.GetPrintRangeCount(nPrintTab);
2539 if (bError)
2540 nRepeats = 0;
2541
2542 for (sal_uInt16 nStep=0; nStep<nRepeats; nStep++)
2543 {
2544 bool bDoThis = true;
2545 if (bMultiArea) // go through all Areas
2546 {
2547 const ScRange* pThisRange = rDoc.GetPrintRange( nPrintTab, nStep );
2548 if ( pThisRange )
2549 {
2550 nStartCol = pThisRange->aStart.Col();
2551 nStartRow = pThisRange->aStart.Row();
2552 nEndCol = pThisRange->aEnd .Col();
2553 nEndRow = pThisRange->aEnd .Row();
2554 bDoThis = AdjustPrintArea(false);
2555 }
2556 }
2557
2558 if (bDoThis)
2559 {
2560 assert( bPrintAreaValid );
2561 for ( SCCOL nCol = nStartCol; nCol <= nEndCol; ++nCol )
2562 {
2563 if (rDoc.HasColNotes(nCol, nPrintTab))
2564 {
2565 for ( SCROW nRow = nStartRow; nRow <= nEndRow; ++nRow )
2566 {
2567 if ( rDoc.HasNote(nCol, nRow, nPrintTab) )
2568 aNotePosList.emplace_back( nCol, nRow, nPrintTab );
2569 }
2570 }
2571 }
2572 }
2573 }
2574
2575 tools::Long nPages = 0;
2576 tools::Long nNoteNr = 0;
2577 tools::Long nNoteAdd;
2578 do
2579 {
2580 nNoteAdd = PrintNotes( nPages, nNoteNr, false, nullptr );
2581 if (nNoteAdd)
2582 {
2583 nNoteNr += nNoteAdd;
2584 ++nPages;
2585 }
2586 }
2587 while (nNoteAdd);
2588
2589 return nPages;
2590}
2591
2592void ScPrintFunc::InitModes() // set MapModes from nZoom etc.
2593{
2594 aOffset = Point( aSrcOffset.X()*100/nZoom, aSrcOffset.Y()*100/nZoom );
2595
2596 tools::Long nEffZoom = nZoom * static_cast<tools::Long>(nManualZoom);
2598 nScaleX = nScaleY = HMM_PER_TWIPS; // output in 1/100 mm
2599
2600 Fraction aZoomFract( nEffZoom,10000 );
2601 Fraction aHorFract = aZoomFract;
2602
2603 if ( !pPrinter && !bIsRender ) // adjust scale for preview
2604 {
2605 double nFact = pDocShell->GetOutputFactor();
2606 aHorFract = Fraction( static_cast<tools::Long>( nEffZoom / nFact ), 10000 );
2607 }
2608
2609 aLogicMode = MapMode( MapUnit::Map100thMM, Point(), aHorFract, aZoomFract );
2610
2611 Point aLogicOfs( -aOffset.X(), -aOffset.Y() );
2612 aOffsetMode = MapMode( MapUnit::Map100thMM, aLogicOfs, aHorFract, aZoomFract );
2613
2614 Point aTwipsOfs( static_cast<tools::Long>( -aOffset.X() / nScaleX + 0.5 ), static_cast<tools::Long>( -aOffset.Y() / nScaleY + 0.5 ) );
2615 aTwipMode = MapMode( MapUnit::MapTwip, aTwipsOfs, aHorFract, aZoomFract );
2616}
2617
2619{
2620 if ( !pPrinter )
2621 return;
2622
2623 // Configure Printer to Printing
2624
2625 Size aEnumSize = aPageSize;
2626
2627 pPrinter->SetOrientation( bLandscape ? Orientation::Landscape : Orientation::Portrait );
2628 if ( bLandscape )
2629 {
2630 // landscape is always interpreted as a rotation by 90 degrees !
2631 // this leads to non WYSIWIG but at least it prints!
2632 // #i21775#
2633 tools::Long nTemp = aEnumSize.Width();
2634 aEnumSize.setWidth( aEnumSize.Height() );
2635 aEnumSize.setHeight( nTemp );
2636 }
2637 Paper ePaper = SvxPaperInfo::GetSvxPaper( aEnumSize, MapUnit::MapTwip );
2638 sal_uInt16 nPaperBin = pParamSet->Get(ATTR_PAGE_PAPERBIN).GetValue();
2639
2640 pPrinter->SetPaper( ePaper );
2641 if ( PAPER_USER == ePaper )
2642 {
2643 MapMode aPrinterMode = pPrinter->GetMapMode();
2644 MapMode aLocalMode( MapUnit::MapTwip );
2645 pPrinter->SetMapMode( aLocalMode );
2646 pPrinter->SetPaperSizeUser( aEnumSize );
2647 pPrinter->SetMapMode( aPrinterMode );
2648 }
2649
2650 pPrinter->SetPaperBin( nPaperBin );
2651}
2652
2653// rPageRanges = range for all tables
2654// nStartPage = rPageRanges starts at nStartPage
2655// nDisplayStart = continuous number for displaying the page number
2656
2658 tools::Long nStartPage, tools::Long nDisplayStart, bool bDoPrint,
2659 ScPreviewLocationData* pLocationData )
2660{
2661 OSL_ENSURE(pDev,"Device == NULL");
2662 if (!pParamSet)
2663 return 0;
2664
2665 if ( pPrinter && bDoPrint )
2667
2668 InitModes();
2669 if ( pLocationData )
2670 {
2671 pLocationData->SetCellMapMode( aOffsetMode );
2672 pLocationData->SetPrintTab( nPrintTab );
2673 }
2674
2676
2677 tools::Long nPageNo = 0;
2678 tools::Long nPrinted = 0;
2679 tools::Long nEndPage = rPageRanges.GetTotalRange().Max();
2680
2681 sal_uInt16 nRepeats = 1;
2682 if (bMultiArea)
2683 nRepeats = rDoc.GetPrintRangeCount(nPrintTab);
2684 for (sal_uInt16 nStep=0; nStep<nRepeats; nStep++)
2685 {
2686 if (bMultiArea) // replace area
2687 {
2688 CalcZoom(nStep); // also sets nStartCol etc. new
2689 InitModes();
2690 }
2691
2692 SCCOL nX1;
2693 SCROW nY1;
2694 SCCOL nX2;
2695 SCROW nY2;
2696 size_t nCountX;
2697 size_t nCountY;
2698
2699 if (aTableParam.bTopDown) // top-bottom
2700 {
2701 nX1 = nStartCol;
2702 for (nCountX=0; nCountX<m_aRanges.m_nPagesX; nCountX++)
2703 {
2704 OSL_ENSURE(nCountX < m_aRanges.m_xPageEndX->size(), "vector access error for aPageEndX (!)");
2705 nX2 = (*m_aRanges.m_xPageEndX)[nCountX];
2706 for (nCountY=0; nCountY<m_aRanges.m_nPagesY; nCountY++)
2707 {
2708 auto& rPageRow = (*m_aRanges.m_xPageRows)[nCountY];
2709 nY1 = rPageRow.GetStartRow();
2710 nY2 = rPageRow.GetEndRow();
2711 if ( !aTableParam.bSkipEmpty || !rPageRow.IsHidden(nCountX) )
2712 {
2713 if ( rPageRanges.IsSelected( nPageNo+nStartPage+1 ) )
2714 {
2715 PrintPage( nPageNo+nDisplayStart, nX1, nY1, nX2, nY2,
2716 bDoPrint, pLocationData );
2717 ++nPrinted;
2718 }
2719 ++nPageNo;
2720 }
2721 }
2722 nX1 = nX2 + 1;
2723 }
2724 }
2725 else // left to right
2726 {
2727 for (nCountY=0; nCountY<m_aRanges.m_nPagesY; nCountY++)
2728 {
2729 auto& rPageRow = (*m_aRanges.m_xPageRows)[nCountY];
2730 nY1 = rPageRow.GetStartRow();
2731 nY2 = rPageRow.GetEndRow();
2732 nX1 = nStartCol;
2733 for (nCountX=0; nCountX<m_aRanges.m_nPagesX; nCountX++)
2734 {
2735 OSL_ENSURE(nCountX < m_aRanges.m_xPageEndX->size(), "vector access error for aPageEndX");
2736 nX2 = (*m_aRanges.m_xPageEndX)[nCountX];
2737 if ( !aTableParam.bSkipEmpty || !rPageRow.IsHidden(nCountX) )
2738 {
2739 if ( rPageRanges.IsSelected( nPageNo+nStartPage+1 ) )
2740 {
2741 PrintPage( nPageNo+nDisplayStart, nX1, nY1, nX2, nY2,
2742 bDoPrint, pLocationData );
2743 ++nPrinted;
2744 }
2745 ++nPageNo;
2746 }
2747 nX1 = nX2 + 1;
2748 }
2749 }
2750 }
2751 }
2752
2753 aFieldData.aTabName = ScResId( STR_NOTES );
2754
2755 tools::Long nNoteNr = 0;
2756 tools::Long nNoteAdd;
2757 do
2758 {
2759 if ( nPageNo+nStartPage <= nEndPage )
2760 {
2761 bool bPageSelected = rPageRanges.IsSelected( nPageNo+nStartPage+1 );
2762 nNoteAdd = PrintNotes( nPageNo+nStartPage, nNoteNr, bDoPrint && bPageSelected,
2763 ( bPageSelected ? pLocationData : nullptr ) );
2764 if ( nNoteAdd )
2765 {
2766 nNoteNr += nNoteAdd;
2767 if (bPageSelected)
2768 {
2769 ++nPrinted;
2770 bSourceRangeValid = false; // last page was no cell range
2771 }
2772 ++nPageNo;
2773 }
2774 }
2775 else
2776 nNoteAdd = 0;
2777 }
2778 while (nNoteAdd);
2779
2780 if ( bMultiArea )
2781 ResetBreaks(nPrintTab); //breaks correct for displaying
2782
2783 return nPrinted;
2784}
2785
2786void ScPrintFunc::CalcZoom( sal_uInt16 nRangeNo ) // calculate zoom
2787{
2788 sal_uInt16 nRCount = rDoc.GetPrintRangeCount( nPrintTab );
2789 const ScRange* pThisRange = nullptr;
2790 if (nRangeNo != RANGENO_NORANGE && nRangeNo < nRCount)
2791 pThisRange = rDoc.GetPrintRange( nPrintTab, nRangeNo );
2792 if ( pThisRange )
2793 {
2794 nStartCol = pThisRange->aStart.Col();
2795 nStartRow = pThisRange->aStart.Row();
2796 nEndCol = pThisRange->aEnd .Col();
2797 nEndRow = pThisRange->aEnd .Row();
2798 }
2799
2800 if (!AdjustPrintArea(false)) // empty
2801 {
2802 nZoom = 100;
2804 return;
2805 }
2806
2808
2810 {
2811 nZoom = 100;
2812 sal_uInt16 nPagesToFit = aTableParam.nScalePageNum;
2813
2814 // If manual breaks are forced, calculate minimum # pages required
2816 {
2817 sal_uInt16 nMinPages = 0;
2818 std::set<SCROW> aRowBreaks;
2819 std::set<SCCOL> aColBreaks;
2820 rDoc.GetAllRowBreaks(aRowBreaks, nPrintTab, false, true);
2821 rDoc.GetAllColBreaks(aColBreaks, nPrintTab, false, true);
2822 nMinPages = (aRowBreaks.size() + 1) * (aColBreaks.size() + 1);
2823
2824 // #i54993# use min forced by breaks if it's > # pages in
2825 // scale parameter to avoid bottoming out at <= ZOOM_MIN
2826 nPagesToFit = std::max(nMinPages, nPagesToFit);
2827 }
2828
2829 sal_uInt16 nLastFitZoom = 0, nLastNonFitZoom = 0;
2830 while (true)
2831 {
2832 if (nZoom <= ZOOM_MIN)
2833 break;
2834
2835 CalcPages();
2836 bool bFitsPage = (m_aRanges.m_nPagesX * m_aRanges.m_nPagesY <= nPagesToFit);
2837
2838 if (bFitsPage)
2839 {
2840 if (nZoom == 100)
2841 // If it fits at 100%, it's good enough for me.
2842 break;
2843
2844 nLastFitZoom = nZoom;
2845 nZoom = (nLastNonFitZoom + nZoom) / 2;
2846
2847 if (nLastFitZoom == nZoom)
2848 // It converged. Use this zoom level.
2849 break;
2850 }
2851 else
2852 {
2853 if (nZoom - nLastFitZoom <= 1)
2854 {
2855 nZoom = nLastFitZoom;
2856 CalcPages();
2857 break;
2858 }
2859
2860 nLastNonFitZoom = nZoom;
2861 nZoom = (nLastFitZoom + nZoom) / 2;
2862 }
2863 }
2864 }
2865 else if (aTableParam.bScaleTo)
2866 {
2867 nZoom = 100;
2868 sal_uInt16 nW = aTableParam.nScaleWidth;
2869 sal_uInt16 nH = aTableParam.nScaleHeight;
2870
2871 // If manual breaks are forced, calculate minimum # pages required
2873 {
2874 sal_uInt16 nMinPagesW = 0, nMinPagesH = 0;
2875 std::set<SCROW> aRowBreaks;
2876 std::set<SCCOL> aColBreaks;
2877 rDoc.GetAllRowBreaks(aRowBreaks, nPrintTab, false, true);
2878 rDoc.GetAllColBreaks(aColBreaks, nPrintTab, false, true);
2879 nMinPagesW = aColBreaks.size() + 1;
2880 nMinPagesH = aRowBreaks.size() + 1;
2881
2882 // #i54993# use min forced by breaks if it's > # pages in
2883 // scale parameters to avoid bottoming out at <= ZOOM_MIN
2884 nW = std::max(nMinPagesW, nW);
2885 nH = std::max(nMinPagesH, nH);
2886 }
2887
2888 sal_uInt16 nLastFitZoom = 0, nLastNonFitZoom = 0;
2889 while (true)
2890 {
2891 if (nZoom <= ZOOM_MIN)
2892 break;
2893
2894 CalcPages();
2895 bool bFitsPage = ((!nW || (m_aRanges.m_nPagesX <= nW)) && (!nH || (m_aRanges.m_nPagesY <= nH)));
2896
2897 if (bFitsPage)
2898 {
2899 if (nZoom == 100)
2900 // If it fits at 100%, it's good enough for me.
2901 break;
2902
2903 nLastFitZoom = nZoom;
2904 nZoom = (nLastNonFitZoom + nZoom) / 2;
2905
2906 if (nLastFitZoom == nZoom)
2907 // It converged. Use this zoom level.
2908 break;
2909 }
2910 else
2911 {
2912 if (nZoom - nLastFitZoom <= 1)
2913 {
2914 nZoom = nLastFitZoom;
2915 CalcPages();
2916 break;
2917 }
2918
2919 nLastNonFitZoom = nZoom;
2920 nZoom = (nLastFitZoom + nZoom) / 2;
2921 }
2922 }
2923 // tdf#103516 remove the almost blank page(s) for better
2924 // interoperability by using slightly smaller zoom
2925 if (nW > 0 && nH == 0 && m_aRanges.m_nPagesY > 1)
2926 {
2927 sal_uInt32 nLastPagesY = m_aRanges.m_nPagesY;
2928 nLastFitZoom = nZoom;
2929 nZoom *= 0.98;
2930 if (nZoom < nLastFitZoom)
2931 {
2932 CalcPages();
2933 // same page count with smaller zoom: use the original zoom
2934 if (m_aRanges.m_nPagesY == nLastPagesY)
2935 {
2936 nZoom = nLastFitZoom;
2937 CalcPages();
2938 }
2939 }
2940 }
2941 }
2942 else if (aTableParam.bScaleAll)
2943 {
2945 if ( nZoom <= ZOOM_MIN )
2946 nZoom = ZOOM_MIN;
2947 CalcPages();
2948 }
2949 else
2950 {
2951 OSL_ENSURE( aTableParam.bScaleNone, "no scale flag is set" );
2952 nZoom = 100;
2953 CalcPages();
2954 }
2955}
2956
2958{
2959 // Adjust height of head/foot line
2960
2961 InitModes(); // initialize aTwipMode from nZoom
2962 pDev->SetMapMode( aTwipMode ); // head/foot line in Twips
2965
2966 // Page size in Document-Twips
2967 // Calculating Left / Right also in PrintPage
2968
2970 aPageRect.SetLeft( ( aPageRect.Left() + nLeftMargin ) * 100 / nZoom );
2974
2975 Size aDocPageSize = aPageRect.GetSize();
2977 {
2978 aDocPageSize.AdjustWidth( -(tools::Long(PRINT_HEADER_WIDTH)) );
2979 aDocPageSize.AdjustHeight( -(tools::Long(PRINT_HEADER_HEIGHT)) );
2980 }
2981 if (pBorderItem)
2982 {
2983 aDocPageSize.AdjustWidth( -(lcl_LineTotal(pBorderItem->GetLeft()) +
2985 pBorderItem->GetDistance(SvxBoxItemLine::LEFT) +
2986 pBorderItem->GetDistance(SvxBoxItemLine::RIGHT)) );
2987 aDocPageSize.AdjustHeight( -(lcl_LineTotal(pBorderItem->GetTop()) +
2989 pBorderItem->GetDistance(SvxBoxItemLine::TOP) +
2990 pBorderItem->GetDistance(SvxBoxItemLine::BOTTOM)) );
2991 }
2992 if (pShadowItem && pShadowItem->GetLocation() != SvxShadowLocation::NONE)
2993 {
2994 aDocPageSize.AdjustWidth( -(pShadowItem->CalcShadowSpace(SvxShadowItemSide::LEFT) +
2995 pShadowItem->CalcShadowSpace(SvxShadowItemSide::RIGHT)) );
2996 aDocPageSize.AdjustHeight( -(pShadowItem->CalcShadowSpace(SvxShadowItemSide::TOP) +
2997 pShadowItem->CalcShadowSpace(SvxShadowItemSide::BOTTOM)) );
2998 }
2999 return aDocPageSize;
3000}
3001
3002void ScPrintFunc::ResetBreaks( SCTAB nTab ) // Set Breaks correctly for view
3003{
3004 rDoc.SetPageSize( nTab, GetDocPageSize() );
3005 rDoc.UpdatePageBreaks( nTab );
3006}
3007
3008static void lcl_SetHidden( const ScDocument& rDoc, SCTAB nPrintTab, ScPageRowEntry& rPageRowEntry,
3009 SCCOL nStartCol, const std::vector< SCCOL >& rPageEndX )
3010{
3011 size_t nPagesX = rPageRowEntry.GetPagesX();
3012 SCROW nStartRow = rPageRowEntry.GetStartRow();
3013 SCROW nEndRow = rPageRowEntry.GetEndRow();
3014
3015 bool bLeftIsEmpty = false;
3016 ScRange aTempRange;
3017 tools::Rectangle aTempRect = rDoc.GetMMRect( 0,0, 0,0, 0 );
3018
3019 for (size_t i=0; i<nPagesX; i++)
3020 {
3021 OSL_ENSURE(i < rPageEndX.size(), "vector access error for aPageEndX");
3022 SCCOL nEndCol = rPageEndX[i];
3023 if ( rDoc.IsPrintEmpty( nStartCol, nStartRow, nEndCol, nEndRow, nPrintTab,
3024 bLeftIsEmpty, &aTempRange, &aTempRect ) )
3025 {
3026 rPageRowEntry.SetHidden(i);
3027 bLeftIsEmpty = true;
3028 }
3029 else
3030 bLeftIsEmpty = false;
3031
3032 nStartCol = nEndCol+1;
3033 }
3034}
3035
3036void ScPrintFunc::CalcPages() // calculates aPageRect and pages from nZoom
3037{
3038 assert( bPrintAreaValid );
3039
3042 GetDocPageSize());
3043 m_aRanges.calculate(rDoc, aInput);
3044}
3045
3046namespace sc
3047{
3048
3050 : m_nPagesX(0)
3051 , m_nPagesY(0)
3052 , m_nTotalY(0)
3053{}
3054
3056{
3057 // Already calculated?
3058 if (m_aInput == rInput)
3059 return;
3060
3061 m_aInput = rInput;
3062
3064
3065 // Clear the map to prevent any outdated values to "survive" when
3066 // we have to recalculate the new values anyway
3067 m_xPageRows->clear();
3068
3069 // #i123672# use dynamic mem to react on size changes
3070 if (m_xPageEndX->size() < static_cast<size_t>(rDoc.MaxCol()) + 1)
3071 {
3072 m_xPageEndX->resize(rDoc.MaxCol()+1, SCCOL());
3073 }
3074
3076 {
3078 rDoc.UpdatePageBreaks(m_aInput.getPrintTab(), &aRange);
3079 }
3080 else
3081 {
3082 rDoc.UpdatePageBreaks(m_aInput.getPrintTab()); // else, end is marked
3083 }
3084
3085 const size_t nRealCnt = m_aInput.getEndRow() - m_aInput.getStartRow() + 1;
3086
3087 // #i123672# use dynamic mem to react on size changes
3088 if (m_xPageEndY->size() < nRealCnt+1)
3089 {
3090 m_xPageEndY->resize(nRealCnt + 1, SCROW());
3091 }
3092
3093 // Page alignment/splitting after breaks in Col/RowFlags
3094 // Of several breaks in a hidden area, only one counts.
3095
3096 m_nPagesX = 0;
3097 m_nPagesY = 0;
3098 m_nTotalY = 0;
3099
3100 bool bVisCol = false;
3102 {
3103 bool bHidden = rDoc.ColHidden(i, m_aInput.getPrintTab());
3104 bool bPageBreak(rDoc.HasColBreak(i, m_aInput.getPrintTab()) & ScBreakType::Page);
3105 if (i > m_aInput.getStartColumn() && bVisCol && bPageBreak)
3106 {
3107 OSL_ENSURE(m_nPagesX < m_xPageEndX->size(), "vector access error for aPageEndX");
3108 (*m_xPageEndX)[m_nPagesX] = i-1;
3109 ++m_nPagesX;
3110 bVisCol = false;
3111 }
3112 if (!bHidden)
3113 bVisCol = true;
3114 }
3115 if (bVisCol) // also at the end, no empty pages
3116 {
3117 OSL_ENSURE(m_nPagesX < m_xPageEndX->size(), "vector access error for aPageEndX");
3118 (*m_xPageEndX)[m_nPagesX] = m_aInput.getEndColumn();
3119 ++m_nPagesX;
3120 }
3121
3122 bool bVisRow = false;
3123 SCROW nPageStartRow = m_aInput.getStartRow();
3124 SCROW nLastVisibleRow = -1;
3125
3126 std::unique_ptr<ScRowBreakIterator> pRowBreakIter(rDoc.GetRowBreakIterator(m_aInput.getPrintTab()));
3127 SCROW nNextPageBreak = pRowBreakIter->first();
3128 while (nNextPageBreak != ScRowBreakIterator::NOT_FOUND && nNextPageBreak < m_aInput.getStartRow())
3129 // Skip until the page break position is at the start row or greater.
3130 nNextPageBreak = pRowBreakIter->next();
3131
3132 for (SCROW nRow = m_aInput.getStartRow(); nRow <= m_aInput.getEndRow(); ++nRow)
3133 {
3134 bool bPageBreak = (nNextPageBreak == nRow);
3135 if (bPageBreak)
3136 nNextPageBreak = pRowBreakIter->next();
3137
3138 if (nRow > m_aInput.getStartRow() && bVisRow && bPageBreak)
3139 {
3140 OSL_ENSURE(m_nTotalY < m_xPageEndY->size(), "vector access error for rPageEndY");
3141 (*m_xPageEndY)[m_nTotalY] = nRow - 1;
3142 ++m_nTotalY;
3143
3145 {
3146 auto& rPageRow = (*m_xPageRows)[m_nPagesY];
3147 rPageRow.SetStartRow(nPageStartRow);
3148 rPageRow.SetEndRow(nRow - 1);
3149 rPageRow.SetPagesX(m_nPagesX);
3152 ++m_nPagesY;
3153 }
3154
3155 nPageStartRow = nRow;
3156 bVisRow = false;
3157 }
3158
3159 if (nRow <= nLastVisibleRow)
3160 {
3161 // This row is still visible. Don't bother calling RowHidden() to
3162 // find out, for speed optimization.
3163 bVisRow = true;
3164 continue;
3165 }
3166
3167 SCROW nLastRow = -1;
3168 if (!rDoc.RowHidden(nRow, m_aInput.getPrintTab(), nullptr, &nLastRow))
3169 {
3170 bVisRow = true;
3171 nLastVisibleRow = nLastRow;
3172 }
3173 else
3174 {
3175 // Skip all hidden rows until next pagebreak.
3176 nRow = ((nNextPageBreak == ScRowBreakIterator::NOT_FOUND) ? nLastRow :
3177 std::min(nLastRow, nNextPageBreak - 1));
3178 }
3179 }
3180
3181 if (!bVisRow)
3182 return;
3183
3184 OSL_ENSURE(m_nTotalY < m_xPageEndY->size(), "vector access error for maPageEndY");
3185 (*m_xPageEndY)[m_nTotalY] = m_aInput.getEndRow();
3186 ++m_nTotalY;
3187
3189 {
3190 auto& rPageRow = (*m_xPageRows)[m_nPagesY];
3191 rPageRow.SetStartRow(nPageStartRow);
3192 rPageRow.SetEndRow(m_aInput.getEndRow());
3193 rPageRow.SetPagesX(m_nPagesX);
3196 ++m_nPagesY;
3197 }
3198}
3199
3200} // end namespace sc
3201/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::chart::ChartAxisLabelPosition ePos
sal_Int32 nLineWidth
void ScColToAlpha(OUStringBuffer &rBuf, SCCOL nCol)
append alpha representation of column to buffer
Definition: address.cxx:1884
const SCROW SCROW_REPEAT_NONE
Definition: address.hxx:94
const SCCOL SCCOL_REPEAT_NONE
Definition: address.hxx:93
size_t SCSIZE
size_t typedef to be able to find places where code was changed from USHORT to size_t and is used to ...
Definition: address.hxx:44
SvxGraphicPosition
GPOS_MT
GPOS_LT
GPOS_RT
GPOS_NONE
GPOS_MM
GPOS_TILED
GPOS_AREA
GPOS_MB
GPOS_LB
GPOS_LM
GPOS_RM
GPOS_RB
sal_uInt16 GetValue() const
static rtl::Reference< SfxItemPool > CreatePool()
virtual SdrPageView * ShowSdrPage(SdrPage *pPage) override
GraphicType GetType() const
void DrawTiled(OutputDevice &rOut, const tools::Rectangle &rArea, const Size &rSize, const Size &rOffset, int nTileCacheSize1D=128)
Size GetPrefSize() const
bool IsSupportedGraphic() const
MapMode GetPrefMapMode() const
void Draw(OutputDevice &rOutDev, const Point &rDestPt) const
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
OUString GetLastName(DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
const Fraction & GetScaleX() const
MapUnit GetMapUnit() const
const Fraction & GetScaleY() const
const Range & GetTotalRange() const
bool IsSelected(sal_Int32 nIndex) const
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
void SetMapMode()
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
OutDevType GetOutDevType() const
void IntersectClipRegion(const tools::Rectangle &rRect)
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
tools::Long Max() const
SC_DLLPUBLIC void Format(OStringBuffer &r, ScRefFlags nFlags, const ScDocument *pDocument=nullptr, const Details &rDetails=detailsOOOa1) const
Definition: address.cxx:2074
SCROW Row() const
Definition: address.hxx:274
void SetTab(SCTAB nTabP)
Definition: address.hxx:295
SCCOL Col() const
Definition: address.hxx:279
void UpdatePendingRowHeights(SCTAB nUpdateTab, bool bBefore=false)
Definition: docsh5.cxx:442
void PostPaint(SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, PaintPartFlags nPart, sal_uInt16 nExtFlags=0)
Definition: docsh3.cxx:101
double GetOutputFactor() const
Definition: docsh.hxx:358
SC_DLLPUBLIC sal_uInt16 GetRowHeight(SCROW nRow, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: document.cxx:4161
bool IsPrintEmpty(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, bool bLeftIsEmpty=false, ScRange *pLastRange=nullptr, tools::Rectangle *pLastMM=nullptr) const
Definition: documen9.cxx:423
SC_DLLPUBLIC ScRange GetRange(SCTAB nTab, const tools::Rectangle &rMMRect, bool bHiddenAsZero=true) const
Definition: documen3.cxx:1797
SC_DLLPUBLIC sal_uInt16 GetColWidth(SCCOL nCol, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: document.cxx:4122
void UpdatePageBreaks(SCTAB nTab, const ScRange *pUserArea=nullptr)
Definition: document.cxx:6210
SC_DLLPUBLIC bool ExtendMerge(SCCOL nStartCol, SCROW nStartRow, SCCOL &rEndCol, SCROW &rEndRow, SCTAB nTab, bool bRefresh=false)
Definition: document.cxx:5556
tools::Long GetScaledRowHeight(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, double fScale) const
Definition: document.cxx:4198
SC_DLLPUBLIC bool HasColNotes(SCCOL nCol, SCTAB nTab) const
Definition: document.cxx:6652
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:892
SC_DLLPUBLIC bool GetPrintAreaVer(SCTAB nTab, SCCOL nStartCol, SCCOL nEndCol, SCROW &rEndRow, bool bNotes) const
Definition: documen2.cxx:657
SC_DLLPUBLIC ScDocumentPool * GetPool()
Definition: document.cxx:6050
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const
Definition: documen3.cxx:492
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:893
SC_DLLPUBLIC ScPostIt * GetNote(const ScAddress &rPos)
Definition: document.cxx:6587
void FillInfo(ScTableInfo &rTabInfo, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCTAB nTab, double fColScale, double fRowScale, bool bPageMode, bool bFormulaMode, const ScMarkData *pMarkData=nullptr)
Definition: fillinfo.cxx:355
SC_DLLPUBLIC const ScRange * GetPrintRange(SCTAB nTab, sal_uInt16 nPos)
Definition: document.cxx:6268
ScRowBreakIterator * GetRowBreakIterator(SCTAB nTab) const
Definition: document.cxx:6379
SC_DLLPUBLIC OutputDevice * GetRefDevice()
Definition: documen8.cxx:199
bool IsEmbedded() const
Definition: document.hxx:952
SC_DLLPUBLIC const ScViewOptions & GetViewOptions() const
Definition: documen3.cxx:1951
SC_DLLPUBLIC OUString GetPageStyle(SCTAB nTab) const
Definition: document.cxx:6176
SC_DLLPUBLIC bool HasPrintRange()
Definition: document.cxx:6239
SC_DLLPUBLIC bool GetPrintAreaHor(SCTAB nTab, SCROW nStartRow, SCROW nEndRow, SCCOL &rEndCol) const
Definition: documen2.cxx:635
SC_DLLPUBLIC ScBreakType HasColBreak(SCCOL nCol, SCTAB nTab) const
Definition: document.cxx:4369
SC_DLLPUBLIC ScDrawLayer * GetDrawLayer()
Definition: document.hxx:1084
SC_DLLPUBLIC bool RowHidden(SCROW nRow, SCTAB nTab, SCROW *pFirstRow=nullptr, SCROW *pLastRow=nullptr) const
Definition: document.cxx:4416
SC_DLLPUBLIC bool HasNote(const ScAddress &rPos) const
Definition: document.cxx:6618
SC_DLLPUBLIC void GetAllColBreaks(std::set< SCCOL > &rBreaks, SCTAB nTab, bool bPage, bool bManual) const
Definition: document.cxx:4349
SC_DLLPUBLIC bool HasAttrib(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, HasAttrFlags nMask) const
Definition: document.cxx:5161
void GetEmbedded(ScRange &rRange) const
Definition: documen3.cxx:1703
void SetPageSize(SCTAB nTab, const Size &rSize)
Definition: document.cxx:6183
SC_DLLPUBLIC std::optional< ScRange > GetRepeatColRange(SCTAB nTab)
Definition: document.cxx:6276
SC_DLLPUBLIC ScStyleSheetPool * GetStyleSheetPool() const
Definition: document.cxx:6055
void ResetEmbedded()
Definition: documen3.cxx:1744
void ApplyAsianEditSettings(ScEditEngineDefaulter &rEngine)
Definition: documen9.cxx:662
SC_DLLPUBLIC std::optional< ScRange > GetRepeatRowRange(SCTAB nTab)
Definition: document.cxx:6284
SC_DLLPUBLIC bool ColHidden(SCCOL nCol, SCTAB nTab, SCCOL *pFirstCol=nullptr, SCCOL *pLastCol=nullptr) const
Definition: document.cxx:4430
SC_DLLPUBLIC bool GetPrintArea(SCTAB nTab, SCCOL &rEndCol, SCROW &rEndRow, bool bNotes=true) const
Definition: documen2.cxx:611
SC_DLLPUBLIC void GetAllRowBreaks(std::set< SCROW > &rBreaks, SCTAB nTab, bool bPage, bool bManual) const
Definition: document.cxx:4343
SC_DLLPUBLIC bool IsVisible(SCTAB nTab) const
Definition: document.cxx:890
SC_DLLPUBLIC bool IsLayoutRTL(SCTAB nTab) const
Definition: document.cxx:974
SC_DLLPUBLIC bool HasTable(SCTAB nTab) const
Definition: document.cxx:2502
SfxPrinter * GetPrinter(bool bCreateIfNotExist=true)
Definition: documen8.cxx:114
SC_DLLPUBLIC sal_uInt16 GetPrintRangeCount(SCTAB nTab)
Definition: document.cxx:6261
bool IsPrintEntireSheet(SCTAB nTab) const
Returns true, if the specified sheet is always printed.
Definition: document.cxx:6255
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
Definition: document.cxx:204
void ExtendPrintArea(OutputDevice *pDev, SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL &rEndCol, SCROW nEndRow) const
Find the maximum column position that contains printable data for the specified row range.
Definition: documen3.cxx:2096
void SetRepeatArea(SCTAB nTab, SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCROW nEndRow)
Definition: document.cxx:6198
SC_DLLPUBLIC tools::Rectangle GetMMRect(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: documen3.cxx:1986
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:297
void SetEmbedded(const ScRange &rRange)
Definition: documen3.cxx:1738
static OUString ModifyDelimiters(const OUString &rOld)
Definition: editutil.cxx:65
static bool IsSystemRTL()
Definition: global.cxx:895
tools::Long GetScrH() const
Definition: output.hxx:340
void PostPrintDrawingLayer(const Point &rMMOffset)
Definition: output3.cxx:104
void AddPDFNotes()
Definition: output.cxx:2528
void SetSnapPixel()
Definition: output.cxx:267
void DrawStrings(bool bPixelToLogic=false)
Definition: output2.cxx:1476
void PrintDrawingLayer(SdrLayerID nLayer, const Point &rMMOffset)
Definition: output3.cxx:135
void DrawSparklines(vcl::RenderContext &rRenderContext)
Definition: output.cxx:2306
void SetShowNullValues(bool bSet)
Definition: output.cxx:252
void DrawFrame(vcl::RenderContext &rRenderContext)
Definition: output.cxx:1387
void DrawExtraShadow(bool bLeft, bool bTop, bool bRight, bool bBottom)
Definition: output.cxx:1191
void DrawShadow()
Definition: output.cxx:1186
void DrawBackground(vcl::RenderContext &rRenderContext)
Definition: output.cxx:1022
void SetGridColor(const Color &rColor)
Definition: output.cxx:242
void DrawEdit(bool bPixelToLogic)
Definition: output2.cxx:4350
void DrawGrid(vcl::RenderContext &rRenderContext, bool bGrid, bool bPage, bool bMergeCover=false)
Definition: output.cxx:296
Point PrePrintDrawingLayer(tools::Long nLogStX, tools::Long nLogStY)
Definition: output3.cxx:38
void SetMetaFileMode(bool bNewMode)
Definition: output.cxx:279
void SetRefDevice(OutputDevice *pRDev)
Definition: output.hxx:321
void SetUseStyleColor(bool bSet)
Definition: output.hxx:328
void SetShowFormulas(bool bSet)
Definition: output.cxx:257
void SetDrawView(FmFormView *pNew)
Definition: output.hxx:325
tools::Long GetScrW() const
Definition: output.hxx:339
size_t GetCount() const
Definition: pagedata.hxx:73
ScPrintRangeData & GetData(size_t i)
Definition: pagedata.cxx:60
const EditTextObject * GetCenterArea() const
Definition: attrib.hxx:191
const EditTextObject * GetLeftArea() const
Definition: attrib.hxx:190
const EditTextObject * GetRightArea() const
Definition: attrib.hxx:192
SCROW GetEndRow() const
Definition: printfun.hxx:84
size_t CountVisible() const
Definition: printfun.cxx:136
void SetPagesX(size_t nNew)
Definition: printfun.cxx:111
bool IsHidden(size_t nX) const
Definition: printfun.cxx:131
size_t nPagesX
Definition: printfun.hxx:73
ScPageRowEntry & operator=(const ScPageRowEntry &r)
Definition: printfun.cxx:101
SCROW nStartRow
Definition: printfun.hxx:71
std::vector< bool > aHidden
Definition: printfun.hxx:74
ScPageRowEntry()
Cache Number of really visible?
Definition: printfun.hxx:78
void SetHidden(size_t nX)
Definition: printfun.cxx:117
size_t GetPagesX() const
Definition: printfun.hxx:85
SCROW GetStartRow() const
Definition: printfun.hxx:83
Contains the "scale to width/height" attribute in page styles.
Definition: attrib.hxx:230
bool IsValid() const
Definition: attrib.hxx:249
sal_uInt16 GetHeight() const
Definition: attrib.hxx:248
sal_uInt16 GetWidth() const
Definition: attrib.hxx:247
static void fillFont(vcl::Font &rFont, const SfxItemSet &rItemSet, ScAutoFontColorMode eAutoMode, const OutputDevice *pOutDev=nullptr, const Fraction *pScale=nullptr, const SfxItemSet *pCondSet=nullptr, SvtScriptType nScript=SvtScriptType::NONE, const Color *pBackConfigColor=nullptr, const Color *pTextConfigColor=nullptr)
Definition: patattr.cxx:250
const SfxPoolItem & GetItem(sal_uInt16 nWhichP) const
Definition: patattr.hxx:73
void FillEditItemSet(SfxItemSet *pEditSet, const SfxItemSet *pCondSet=nullptr) const
Converts all Calc items contained in the own item set to edit engine items and puts them into pEditSe...
Definition: patattr.cxx:868
Additional class containing cell annotation data.
Definition: postit.hxx:58
void AddColHeaders(const tools::Rectangle &rRect, SCCOL nStartCol, SCCOL nEndCol, bool bRepCol)
Definition: prevloc.cxx:210
void AddCellRange(const tools::Rectangle &rRect, const ScRange &rRange, bool bRepCol, bool bRepRow, const MapMode &rDrawMap)
Definition: prevloc.cxx:178
void SetPrintTab(SCTAB nNew)
Definition: prevloc.cxx:166
void AddNoteMark(const tools::Rectangle &rRect, const ScAddress &rPos)
Definition: prevloc.cxx:240
void AddRowHeaders(const tools::Rectangle &rRect, SCROW nStartRow, SCROW nEndRow, bool bRepRow)
Definition: prevloc.cxx:219
void SetCellMapMode(const MapMode &rMapMode)
Definition: prevloc.cxx:161
void AddHeaderFooter(const tools::Rectangle &rRect, bool bHeader, bool bLeft)
Definition: prevloc.cxx:228
void AddNoteText(const tools::Rectangle &rRect, const ScAddress &rPos)
Definition: prevloc.cxx:248
tools::Long TextHeight(const EditTextObject *pObject)
Definition: printfun.cxx:788
void SetRenderFlag(bool bFlag)
Definition: printfun.cxx:2408
ScDocument & rDoc
Definition: printfun.hxx:232
bool bMultiArea
Definition: printfun.hxx:280
void InitParam(const ScPrintOptions *pOptions)
Definition: printfun.cxx:859
sal_uInt16 nRightMargin
Definition: printfun.hxx:258
const SvxBoxItem * pBorderItem
Definition: printfun.hxx:267
SCCOL nStartCol
Definition: printfun.hxx:298
double nScaleY
Definition: printfun.hxx:291
void PrintArea(SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, tools::Long nScrX, tools::Long nScrY, bool bShLeft, bool bShTop, bool bShRight, bool bShBottom)
Definition: printfun.cxx:1590
SCROW nRepeatEndRow
Definition: printfun.hxx:296
Size GetDataSize() const
Definition: printfun.cxx:1118
void PrintHF(tools::Long nPageNo, bool bHeader, tools::Long nStartY, bool bDoPrint, ScPreviewLocationData *pLocationData)
Definition: printfun.cxx:1762
void LocateArea(SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, tools::Long nScrX, tools::Long nScrY, bool bRepCol, bool bRepRow, ScPreviewLocationData &rLocationData)
Definition: printfun.cxx:1549
bool GetLastSourceRange(ScRange &rRange) const
Definition: printfun.cxx:379
SCCOL nEndCol
Definition: printfun.hxx:300
FmFormView * pDrawView
Definition: printfun.hxx:235
bool bCenterVer
Definition: printfun.hxx:261
bool bCenterHor
Definition: printfun.hxx:260
bool bPrintAreaValid
Definition: printfun.hxx:302
std::vector< ScAddress > aNotePosList
Definition: printfun.hxx:311
Size aPageSize
Definition: printfun.hxx:266
void InitModes()
Definition: printfun.cxx:2592
SCCOL nRepeatEndCol
Definition: printfun.hxx:294
tools::Long nDocPages
Definition: printfun.hxx:248
ScPrintHFParam aHdr
Definition: printfun.hxx:272
void CalcPages()
Definition: printfun.cxx:3036
void FillPageData()
Definition: printfun.cxx:385
MapMode aOldPrinterMode
Definition: printfun.hxx:237
tools::Long DoPrint(const MultiSelection &rPageRanges, tools::Long nStartPage, tools::Long nDisplayStart, bool bDoPrint, ScPreviewLocationData *pLocationData)
Definition: printfun.cxx:2657
tools::Long nPageStart
Definition: printfun.hxx:247
SCROW nRepeatStartRow
Definition: printfun.hxx:295
void SetOffset(const Point &rOfs)
Definition: printfun.cxx:2386
ScPrintHFParam aFtr
Definition: printfun.hxx:273
Point aOffset
Definition: printfun.hxx:240
SCROW nEndRow
Definition: printfun.hxx:301
void SetDrawView(FmFormView *pNew)
Definition: printfun.cxx:434
void LocateColHdr(SCCOL nX1, SCCOL nX2, tools::Long nScrX, tools::Long nScrY, bool bRepCol, ScPreviewLocationData &rLocationData)
Definition: printfun.cxx:1508
const SvxShadowItem * pShadowItem
Definition: printfun.hxx:269
MapMode aOffsetMode
Definition: printfun.hxx:288
MapMode aLogicMode
Definition: printfun.hxx:287
VclPtr< SfxPrinter > pPrinter
Definition: printfun.hxx:233
void LocateRowHdr(SCROW nY1, SCROW nY2, tools::Long nScrX, tools::Long nScrY, bool bRepRow, ScPreviewLocationData &rLocationData)
Definition: printfun.cxx:1529
Point aSrcOffset
Definition: printfun.hxx:239
bool bIsRender
Definition: printfun.hxx:244
tools::Long DoNotes(tools::Long nNoteStart, bool bDoPrint, ScPreviewLocationData *pLocationData)
Definition: printfun.cxx:1900
std::unique_ptr< ScHeaderEditEngine > pEditEngine
Definition: printfun.hxx:306
ScHeaderFieldData aFieldData
Definition: printfun.hxx:309
tools::Rectangle aPageRect
Definition: printfun.hxx:285
sal_uInt16 nManualZoom
Definition: printfun.hxx:241
const ScRange * pUserArea
Definition: printfun.hxx:250
bool IsMirror(tools::Long nPageNo)
Definition: printfun.cxx:1698
void SetDateTime(const DateTime &)
Definition: printfun.cxx:1137
void PrintPage(tools::Long nPageNo, SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, bool bDoPrint, ScPreviewLocationData *pLocationData)
Definition: printfun.cxx:2040
SCCOL nRepeatStartCol
Definition: printfun.hxx:293
bool bPrintCurrentTable
Definition: printfun.hxx:279
static void DrawToDev(ScDocument &rDoc, OutputDevice *pDev, double nPrintFactor, const tools::Rectangle &rBound, ScViewData *pViewData, bool bMetaFile)
Definition: printfun.cxx:466
ScPrintFunc(ScDocShell *pShell, SfxPrinter *pNewPrinter, SCTAB nTab, tools::Long nPage=0, tools::Long nDocP=0, const ScRange *pArea=nullptr, const ScPrintOptions *pOptions=nullptr, ScPageBreakData *pData=nullptr)
Definition: printfun.cxx:198
MapMode aTwipMode
Definition: printfun.hxx:289
ScDocShell * pDocShell
Definition: printfun.hxx:231
tools::Long CountPages()
Definition: printfun.cxx:2459
const SfxItemSet * pParamSet
Definition: printfun.hxx:252
void SetClearFlag(bool bFlag)
Definition: printfun.cxx:2396
ScPageAreaParam aAreaParam
Definition: printfun.hxx:275
VclPtr< OutputDevice > pDev
Definition: printfun.hxx:234
bool UpdatePages()
Definition: printfun.cxx:2426
double nScaleX
Definition: printfun.hxx:290
void PrintRowHdr(SCROW nY1, SCROW nY2, tools::Long nScrX, tools::Long nScrY)
Definition: printfun.cxx:1467
sal_uInt16 nZoom
Definition: printfun.hxx:278
void SetManualZoom(sal_uInt16 nNewZoom)
Definition: printfun.cxx:2391
void MakeEditEngine()
Definition: printfun.cxx:1722
void UpdateHFHeight(ScPrintHFParam &rParam)
Definition: printfun.cxx:801
ScPageBreakData * pPageData
Definition: printfun.hxx:313
std::unique_ptr< SfxItemSet > pEditDefaults
Definition: printfun.hxx:307
void MakeTableString()
Definition: printfun.cxx:1715
void Construct(const ScPrintOptions *pOptions)
Definition: printfun.cxx:155
bool bUseStyleColor
Definition: printfun.hxx:243
bool bSourceRangeValid
Definition: printfun.hxx:263
bool bClearWin
Definition: printfun.hxx:242
ScRange aLastSourceRange
Definition: printfun.hxx:271
void GetPrintState(ScPrintState &rState, bool bSavePageRanges=false)
Definition: printfun.cxx:353
const SvxBrushItem * pBackgroundItem
Definition: printfun.hxx:268
bool mbHasPrintRange
Definition: printfun.hxx:281
void CalcZoom(sal_uInt16 nRangeNo)
Definition: printfun.cxx:2786
void PrintColHdr(SCCOL nX1, SCCOL nX2, tools::Long nScrX, tools::Long nScrY)
Definition: printfun.cxx:1418
bool AdjustPrintArea(bool bNew)
Definition: printfun.cxx:704
sal_uInt16 nTopMargin
Definition: printfun.hxx:257
sc::PrintPageRanges m_aRanges
Definition: printfun.hxx:304
bool bFromPrintState
Definition: printfun.hxx:253
sal_uInt16 nBottomMargin
Definition: printfun.hxx:259
tools::Long PrintNotes(tools::Long nPageNo, tools::Long nNoteStart, bool bDoPrint, ScPreviewLocationData *pLocationData)
Definition: printfun.cxx:1974
SCTAB nPrintTab
Definition: printfun.hxx:246
bool IsLeft(tools::Long nPageNo)
Definition: printfun.cxx:1703
Size GetDocPageSize()
Definition: printfun.cxx:2957
void GetScaleData(Size &rPhysSize, tools::Long &rDocHdr, tools::Long &rDocFtr)
Definition: printfun.cxx:1127
void DrawBorder(tools::Long nScrX, tools::Long nScrY, tools::Long nScrW, tools::Long nScrH, const SvxBoxItem *pBorderData, const SvxBrushItem *pBackground, const SvxShadowItem *pShadow)
Definition: printfun.cxx:1282
bool bLandscape
Definition: printfun.hxx:262
tools::Long CountNotePages()
Definition: printfun.cxx:2527
sal_uInt16 nLeftMargin
Definition: printfun.hxx:256
SvxPageUsage nPageUsage
Definition: printfun.hxx:265
tools::Long nTabPages
Definition: printfun.hxx:282
void ApplyPrintSettings()
Definition: printfun.cxx:2618
void SetUseStyleColor(bool bFlag)
Definition: printfun.cxx:2401
void ResetBreaks(SCTAB nTab)
Definition: printfun.cxx:3002
ScPageTableParam aTableParam
Definition: printfun.hxx:274
void SetExclusivelyDrawOleAndDrawObjects()
Definition: printfun.cxx:2413
tools::Long nTotalPages
Definition: printfun.hxx:283
SCROW nStartRow
Definition: printfun.hxx:299
bool GetSkipEmpty() const
Definition: printopt.hxx:36
bool GetForceBreaks() const
Definition: printopt.hxx:40
void SetTopDown(bool bSet)
Definition: pagedata.hxx:56
void SetAutomatic(bool bSet)
Definition: pagedata.hxx:58
void SetPrintRange(const ScRange &rNew)
Definition: pagedata.hxx:43
void SetPagesY(size_t nCount, const SCROW *pEnd)
Definition: pagedata.cxx:42
void SetPagesX(size_t nCount, const SCCOL *pEnd)
Definition: pagedata.cxx:36
ScAddress aEnd
Definition: address.hxx:498
ScAddress aStart
Definition: address.hxx:497
static constexpr SCROW NOT_FOUND
Definition: dociter.hxx:429
SCTAB GetTabNo() const
Definition: viewdata.hxx:395
SCROW GetPosY(ScVSplitPos eWhich, SCTAB nForTab=-1) const
Definition: viewdata.cxx:1417
const MapMode & GetLogicMode(ScSplitPos eWhich)
Definition: viewdata.cxx:3020
SCROW VisibleCellsY(ScVSplitPos eWhichY) const
Definition: viewdata.cxx:2717
ScSplitPos GetActivePart() const
Definition: viewdata.hxx:398
SCCOL VisibleCellsX(ScHSplitPos eWhichX) const
Definition: viewdata.cxx:2712
SCCOL GetPosX(ScHSplitPos eWhich, SCTAB nForTab=-1) const
Definition: viewdata.cxx:1403
bool GetOption(ScViewOption eOpt) const
Definition: viewopti.hxx:86
const SdrPage * GetPage(sal_uInt16 nPgNum) const
void setHideOle(bool bNew)
void setHideFormControl(bool bNew)
bool getHideFormControl() const
void SetPrintPreview(bool bOn=true)
bool getHideDraw() const
void setHideDraw(bool bNew)
bool getHideOle() const
SdrModel & GetModel() const
bool getHideChart() const
void setHideChart(bool bNew)
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
SfxItemPool * GetPool() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
const INetURLObject & GetURLObject() const
const OUString & GetName() const
css::uno::Reference< css::document::XDocumentProperties > getDocProperties() const
bool HasName() const
SfxMedium * GetMedium() const
OUString GetTitle(sal_uInt16 nMaxLen=0) const
std::unique_ptr< SfxPoolItem > CloneSetWhich(sal_uInt16 nNewWhich) const
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
virtual SfxItemSet & GetItemSet()
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
const editeng::SvxBorderLine * GetTop() const
const editeng::SvxBorderLine * GetRight() const
const editeng::SvxBorderLine * GetLeft() const
sal_Int16 GetDistance(SvxBoxItemLine nLine, bool bAllowNegative=false) const
const editeng::SvxBorderLine * GetBottom() const
const Color & GetColor() const
const Graphic * GetGraphic(OUString const &referer=OUString()) const
SvxGraphicPosition GetGraphicPos() const
tools::Long GetRight() const
tools::Long GetLeft() const
SvxNumType GetNumType() const
SvxPageUsage GetPageUsage() const
bool IsLandscape() const
static Paper GetSvxPaper(const Size &rSize, MapUnit eUnit)
static Size GetPaperSize(Paper ePaper, MapUnit eUnit=MapUnit::MapTwip)
sal_uInt16 GetWidth() const
const Color & GetColor() const
sal_uInt16 CalcShadowSpace(SvxShadowItemSide nShadow) const
SvxShadowLocation GetLocation() const
sal_uInt16 GetUpper() const
sal_uInt16 GetLower() const
reference_type * get() const
void calculate(ScDocument &rDoc, PrintPageRangesInput const &rInput)
Definition: printfun.cxx:3055
PrintPageRangesInput m_aInput
Definition: printfun.hxx:177
std::shared_ptr< std::vector< SCROW > > m_xPageEndY
Definition: printfun.hxx:170
std::shared_ptr< std::map< size_t, ScPageRowEntry > > m_xPageRows
Definition: printfun.hxx:171
std::shared_ptr< std::vector< SCCOL > > m_xPageEndX
Definition: printfun.hxx:169
constexpr tools::Long GetWidth() const
bool Contains(const Point &rPOINT) const
constexpr void SetLeft(tools::Long v)
bool Overlaps(const tools::Rectangle &rRect) const
constexpr void SetTop(tools::Long v)
constexpr tools::Long Top() const
constexpr Point TopLeft() const
constexpr void SetRight(tools::Long v)
constexpr Size GetSize() const
constexpr tools::Long Right() const
constexpr void SetBottom(tools::Long v)
constexpr tools::Long GetHeight() const
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
int nCount
std::unique_ptr< ScDocument, o3tl::default_delete< ScDocument > > ScDocumentUniquePtr
Definition: document.hxx:2720
@ SCDOCMODE_UNDO
Definition: document.hxx:258
constexpr TypedWhichId< SvxAdjustItem > EE_PARA_JUST(EE_PARA_START+16)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT(EE_CHAR_START+2)
constexpr TypedWhichId< SvxColorItem > EE_CHAR_COLOR(EE_CHAR_START+0)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CTL(EE_CHAR_START+20)
constexpr TypedWhichId< SvxFrameDirectionItem > EE_PARA_WRITINGDIR(EE_PARA_START+0)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CJK(EE_CHAR_START+19)
EmbeddedObjectRef * pObject
constexpr SdrLayerID SC_LAYER_FRONT(0)
@ VOBJ_MODE_SHOW
Definition: global.hxx:369
constexpr SdrLayerID SC_LAYER_INTERN(2)
#define OLE_STD_CELLS_X
Definition: global.hxx:104
constexpr SdrLayerID SC_LAYER_BACK(1)
#define OLE_STD_CELLS_Y
Definition: global.hxx:105
OUString aName
if(aStr !=aBuf) UpdateName_Impl(m_xFollowLb.get()
std::unique_ptr< sal_Int32[]> pData
const SfxPoolItem * GetItem(const SwTextAttr &rAttr, sal_uInt16 nWhich)
size
int i
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
CAUTION! The following defines must be in the same namespace as the respective type.
Definition: broadcast.cxx:15
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
long Long
const char GetValue[]
OUTDEV_PDF
constexpr auto HMM_PER_TWIPS
Definition: output2.cxx:97
@ OUTTYPE_PRINTER
Definition: output.hxx:59
Paper
PAPER_A4
PAPER_USER
ScAutoFontColorMode
how to treat COL_AUTO in GetFont:
Definition: patattr.hxx:44
@ Print
black or white, depending on background
@ Display
from style settings, or black/white if needed
SfxItemState
static void lcl_DrawGraphic(const Graphic &rGraphic, vcl::RenderContext &rOutDev, const tools::Rectangle &rGrf, const tools::Rectangle &rOut)
Definition: printfun.cxx:1142
static void lcl_FillHFParam(ScPrintHFParam &rParam, const SfxItemSet *pHFSet)
Definition: printfun.cxx:660
#define ZOOM_MIN
Definition: printfun.cxx:70
static void lcl_HidePrint(const ScTableInfo &rTabInfo, SCCOL nX1, SCCOL nX2)
Definition: printfun.cxx:439
static void lcl_SetHidden(const ScDocument &rDoc, SCTAB nPrintTab, ScPageRowEntry &rPageRowEntry, SCCOL nStartCol, const std::vector< SCCOL > &rPageEndX)
Definition: printfun.cxx:3008
static tools::Long lcl_LineTotal(const ::editeng::SvxBorderLine *pLine)
Definition: printfun.cxx:150
#define RANGENO_NORANGE
Definition: printfun.hxx:43
constexpr sal_Int64 PRINT_HEADER_HEIGHT
Definition: printfun.hxx:46
constexpr sal_Int64 PRINT_HEADER_WIDTH
Definition: printfun.hxx:45
OUString ScResId(TranslateId aId)
Definition: scdll.cxx:90
constexpr TypedWhichId< SfxUInt16Item > ATTR_PAGE_SCALE(175)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_SHARED(166)
constexpr TypedWhichId< SvxFontHeightItem > ATTR_FONT_HEIGHT(101)
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_FOOTERLEFT(179)
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_HEADERLEFT(178)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_HORCENTER(162)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_DYNAMIC(165)
constexpr TypedWhichId< SvxSizeItem > ATTR_PAGE_SIZE(161)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_NULLVALS(187)
constexpr TypedWhichId< ScPatternAttr > ATTR_PATTERN(156)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_VERCENTER(163)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_HEADERS(170)
constexpr TypedWhichId< SvxSetItem > ATTR_PAGE_HEADERSET(184)
constexpr TypedWhichId< SvxFontHeightItem > ATTR_CJK_FONT_HEIGHT(112)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_FORMULAS(186)
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_FOOTERRIGHT(181)
constexpr TypedWhichId< SvxULSpaceItem > ATTR_ULSPACE(158)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_GRID(169)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_TOPDOWN(174)
constexpr TypedWhichId< ScViewObjectModeItem > ATTR_PAGE_CHARTS(171)
constexpr TypedWhichId< ScViewObjectModeItem > ATTR_PAGE_OBJECTS(172)
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_HEADERRIGHT(180)
constexpr TypedWhichId< SvxBrushItem > ATTR_BACKGROUND(148)
constexpr TypedWhichId< SvxPaperBinItem > ATTR_PAGE_PAPERBIN(160)
constexpr TypedWhichId< SfxUInt16Item > ATTR_PAGE_FIRSTPAGENO(177)
constexpr TypedWhichId< SvxShadowItem > ATTR_SHADOW(152)
constexpr TypedWhichId< SvxPageItem > ATTR_PAGE(159)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_NOTES(168)
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_HEADERFIRST(182)
constexpr TypedWhichId< SvxBoxItem > ATTR_BORDER(150)
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_FOOTERFIRST(183)
constexpr TypedWhichId< ScPageScaleToItem > ATTR_PAGE_SCALETO(188)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_SHARED_FIRST(167)
constexpr TypedWhichId< ScProtectionAttr > ATTR_PROTECTION(149)
constexpr TypedWhichId< SfxUInt16Item > ATTR_PAGE_SCALETOPAGES(176)
constexpr TypedWhichId< SvxSetItem > ATTR_PAGE_FOOTERSET(185)
constexpr TypedWhichId< ScViewObjectModeItem > ATTR_PAGE_DRAWINGS(173)
constexpr TypedWhichId< SvxFontHeightItem > ATTR_CTL_FONT_HEIGHT(117)
constexpr TypedWhichId< SfxBoolItem > ATTR_PAGE_ON(164)
constexpr TypedWhichId< SvxLRSpaceItem > ATTR_LRSPACE(157)
#define SC_MOD()
Definition: scmod.hxx:247
static SfxItemSet & rSet
ScCellInfo & cellInfo(SCCOL nCol)
Definition: fillinfo.hxx:197
ScBasicCellInfo & basicCellInfo(SCCOL nCol)
Definition: fillinfo.hxx:210
const SfxItemSet * pConditionSet
Definition: fillinfo.hxx:154
ScRefCellValue maCell
Definition: fillinfo.hxx:151
const ScPatternAttr * pPatternAttr
Definition: fillinfo.hxx:153
OUString aLongDocName
Definition: editutil.hxx:202
tools::Long nPageNo
Definition: editutil.hxx:206
DateTime aDateTime
Definition: editutil.hxx:205
OUString aShortDocName
Definition: editutil.hxx:203
OUString aTabName
Definition: editutil.hxx:204
SvxNumType eNumType
Definition: editutil.hxx:208
tools::Long nTotalPages
Definition: editutil.hxx:207
ScRange aPrintArea
Definition: pagepar.hxx:59
sal_uInt16 nScaleHeight
Definition: pagepar.hxx:45
sal_uInt16 nScaleAll
Definition: pagepar.hxx:43
bool bScalePageNum
Definition: pagepar.hxx:41
sal_uInt16 nScalePageNum
Definition: pagepar.hxx:46
sal_uInt16 nScaleWidth
Definition: pagepar.hxx:44
sal_uInt16 nFirstPageNo
Definition: pagepar.hxx:47
const SvxBoxItem * pBorder
Definition: printfun.hxx:63
const SvxShadowItem * pShadow
Definition: printfun.hxx:65
tools::Long nHeight
Definition: printfun.hxx:55
sal_uInt16 nDistance
Definition: printfun.hxx:57
const SvxBrushItem * pBack
Definition: printfun.hxx:64
tools::Long nManHeight
Definition: printfun.hxx:56
sal_uInt16 nRight
Definition: printfun.hxx:59
bool bSharedFirst
Definition: printfun.hxx:54
const ScPageHFItem * pRight
Definition: printfun.hxx:61
sal_uInt16 nLeft
Definition: printfun.hxx:58
const ScPageHFItem * pLeft
Definition: printfun.hxx:60
const ScPageHFItem * pFirst
Definition: printfun.hxx:62
std::shared_ptr< std::vector< SCROW > > xPageEndY
Definition: printfun.hxx:206
sal_uInt16 nZoom
Definition: printfun.hxx:192
bool bSavedStateRanges
Definition: printfun.hxx:201
bool bPrintAreaValid
Definition: printfun.hxx:191
tools::Long nTabPages
Definition: printfun.hxx:195
SCROW nEndRow
Definition: printfun.hxx:190
tools::Long nPageStart
Definition: printfun.hxx:197
size_t nPagesY
Definition: printfun.hxx:194
SCCOL nEndCol
Definition: printfun.hxx:189
sc::PrintPageRangesInput aPrintPageRangesInput
Definition: printfun.hxx:202
size_t nPagesX
Definition: printfun.hxx:193
SCTAB nPrintTab
Definition: printfun.hxx:186
size_t nTotalY
Definition: printfun.hxx:203
tools::Long nDocPages
Definition: printfun.hxx:198
std::shared_ptr< std::map< size_t, ScPageRowEntry > > xPageRows
Definition: printfun.hxx:207
SCROW nStartRow
Definition: printfun.hxx:188
std::shared_ptr< std::vector< SCCOL > > xPageEndX
Definition: printfun.hxx:205
tools::Long nTotalPages
Definition: printfun.hxx:196
SCCOL nStartCol
Definition: printfun.hxx:187
SCSIZE mnArrCount
Definition: fillinfo.hxx:267
std::unique_ptr< RowInfo[]> mpRowInfo
Definition: fillinfo.hxx:266
SCROW getStartRow() const
Definition: printfun.hxx:137
SCCOL getEndColumn() const
Definition: printfun.hxx:152
SCTAB getPrintTab() const
Definition: printfun.hxx:157
SCROW getEndRow() const
Definition: printfun.hxx:142
SCCOL getStartColumn() const
Definition: printfun.hxx:147
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17
ScSplitPos
Definition: viewdata.hxx:44
ScHSplitPos WhichH(ScSplitPos ePos)
Definition: viewdata.hxx:722
ScHSplitPos
Definition: viewdata.hxx:45
ScVSplitPos WhichV(ScSplitPos ePos)
Definition: viewdata.hxx:728
ScVSplitPos
Definition: viewdata.hxx:46
@ VOPT_NULLVALS
Definition: viewopti.hxx:33
@ VOPT_GRID
Definition: viewopti.hxx:42
@ VOPT_FORMULAS
Definition: viewopti.hxx:32