summaryrefslogtreecommitdiffstats
path: root/binfilter/bf_svx/source/form/svx_fmpage.cxx
blob: bd3aeebd2f4cdfb93e4bd080a43e438e8a884e03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * Copyright 2000, 2010 Oracle and/or its affiliates.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/

#ifdef _MSC_VER
#pragma hdrstop
#endif

#include "fmpage.hxx"

#include "fmmodel.hxx"

#ifndef SVX_LIGHT
#include "fmresids.hrc"
#endif

#ifndef SVX_LIGHT
#include "fmpgeimp.hxx"
#endif

#include "svdio.hxx"

#ifndef SVX_LIGHT
#include "fmprop.hrc"
using namespace ::binfilter::svxform;
#endif

namespace binfilter {

/*N*/ TYPEINIT1(FmFormPage, SdrPage);

//------------------------------------------------------------------
/*N*/ FmFormPage::FmFormPage(FmFormModel& rModel, StarBASIC* _pBasic, bool bMasterPage)
/*N*/          :SdrPage(rModel, bMasterPage)
/*N*/ #ifndef SVX_LIGHT
/*N*/          ,pImpl(new FmFormPageImpl(this))
/*N*/ #else
/*N*/          ,pImpl(NULL)
/*N*/ #endif
/*N*/          ,pBasic(_pBasic)
/*N*/ {
/*N*/ }

/*N*/ FmFormPage::~FmFormPage()
/*N*/ {
/*N*/ #ifndef SVX_LIGHT
/*N*/   delete pImpl;
/*N*/ #endif
/*N*/ }

/*N*/ void FmFormPage::ReadData(const SdrIOHeader& rHead, SvStream& rIn)
/*N*/ {
/*N*/   {
/*N*/       {
/*N*/           SdrDownCompat aVCCompat1( rIn, STREAM_READ );
/*N*/       }
/*N*/       SdrPage::ReadData( rHead, rIn );
/*N*/       {
/*N*/           SdrDownCompat aVCCompat2( rIn, STREAM_READ );
/*N*/           ByteString aByteStringName;
/*N*/           rIn.ReadByteString(aByteStringName);
/*N*/           aPageName = String(aByteStringName, osl_getThreadTextEncoding());
/*N*/       }
/*N*/   }
/*N*/
/*N*/   // dont use the flag in that way: if (rIn.GetVersion() >= SOFFICE_FILEFORMAT_40)
/*N*/   if (rIn.GetVersion() >= 3830 && rHead.GetVersion() >=14)
/*N*/   {
/*N*/       SdrDownCompat aCompat(rIn, STREAM_READ);    // Fuer Abwaertskompatibilitaet (Lesen neuer Daten mit altem Code)
/*N*/ #ifndef SVX_LIGHT
/*N*/       DBG_ASSERT( aCompat.GetBytesLeft(), "FmFormPage::ReadData: invalid file format!" );
/*N*/       if ( aCompat.GetBytesLeft() )
/*N*/           pImpl->ReadData(rHead, rIn);
/*N*/       // some old (corrupted) versions between 511 and 554 wrote an empty block here - and some of these documents
/*N*/       // are still out there
/*N*/       // So we allow for such an empty block ...
/*N*/ #endif
/*N*/   }
/*N*/ }

//------------------------------------------------------------------
/*N*/ void FmFormPage::SetModel(SdrModel* pNewModel)
/*N*/ {
/*N*/   SdrPage::SetModel( pNewModel );
/*N*/ }

//------------------------------------------------------------------
/*N*/ SdrPage* FmFormPage::Clone() const
/*N*/ {
/*N*/   return new FmFormPage(*this);
/*N*/   // hier fehlt noch ein kopieren der Objekte
/*N*/ }

//------------------------------------------------------------------
/*N*/ void FmFormPage::InsertObject(SdrObject* pObj, ULONG nPos,
/*N*/                             const SdrInsertReason* pReason)
/*N*/ {
/*N*/   SdrPage::InsertObject( pObj, nPos, pReason );
/*N*/ }

//------------------------------------------------------------------
/*N*/ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > & FmFormPage::GetForms() const
/*N*/ {
/*N*/ #ifndef SVX_LIGHT
/*N*/   return pImpl->getForms();
/*N*/ #else
/*N*/   static ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >  aRef;
/*N*/   return aRef;
/*N*/ #endif
/*N*/ }

//------------------------------------------------------------------
/*N*/ SdrObject* FmFormPage::RemoveObject(ULONG nObjNum)
/*N*/ {
/*N*/   SdrObject* pObj = SdrPage::RemoveObject(nObjNum);
/*N*/   return pObj;
/*N*/ }

}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */