fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / core / tool / prnsave.cxx
blob9b2ccfdc1ddfdae08fbef7b749d880b03f61f86a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "prnsave.hxx"
21 #include "global.hxx"
22 #include "address.hxx"
24 #include <osl/diagnose.h>
26 // STATIC DATA
28 // Daten pro Tabelle
30 ScPrintSaverTab::ScPrintSaverTab() :
31 mpRepeatCol(NULL),
32 mpRepeatRow(NULL),
33 mbEntireSheet(false)
37 ScPrintSaverTab::~ScPrintSaverTab()
39 delete mpRepeatCol;
40 delete mpRepeatRow;
43 void ScPrintSaverTab::SetAreas( const ScRangeVec& rRanges, bool bEntireSheet )
45 maPrintRanges = rRanges;
46 mbEntireSheet = bEntireSheet;
49 void ScPrintSaverTab::SetRepeat( const ScRange* pCol, const ScRange* pRow )
51 delete mpRepeatCol;
52 mpRepeatCol = pCol ? new ScRange(*pCol) : NULL;
53 delete mpRepeatRow;
54 mpRepeatRow = pRow ? new ScRange(*pRow) : NULL;
57 inline bool PtrEqual( const ScRange* p1, const ScRange* p2 )
59 return ( !p1 && !p2 ) || ( p1 && p2 && *p1 == *p2 );
62 bool ScPrintSaverTab::operator==( const ScPrintSaverTab& rCmp ) const
64 return
65 PtrEqual( mpRepeatCol, rCmp.mpRepeatCol ) &&
66 PtrEqual( mpRepeatRow, rCmp.mpRepeatRow ) &&
67 (mbEntireSheet == rCmp.mbEntireSheet) &&
68 (maPrintRanges == rCmp.maPrintRanges);
71 // Daten fuer das ganze Dokument
73 ScPrintRangeSaver::ScPrintRangeSaver( SCTAB nCount ) :
74 nTabCount( nCount )
76 if (nCount > 0)
77 pData = new ScPrintSaverTab[nCount];
78 else
79 pData = NULL;
82 ScPrintRangeSaver::~ScPrintRangeSaver()
84 delete[] pData;
87 ScPrintSaverTab& ScPrintRangeSaver::GetTabData(SCTAB nTab)
89 OSL_ENSURE(nTab<nTabCount,"ScPrintRangeSaver Tab too big");
90 return pData[nTab];
93 const ScPrintSaverTab& ScPrintRangeSaver::GetTabData(SCTAB nTab) const
95 OSL_ENSURE(nTab<nTabCount,"ScPrintRangeSaver Tab too big");
96 return pData[nTab];
99 bool ScPrintRangeSaver::operator==( const ScPrintRangeSaver& rCmp ) const
101 bool bEqual = ( nTabCount == rCmp.nTabCount );
102 if (bEqual)
103 for (SCTAB i=0; i<nTabCount; i++)
104 if (!(pData[i]==rCmp.pData[i]))
106 bEqual = false;
107 break;
109 return bEqual;
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */