xref: /AOO41X/main/svx/source/dialog/pagectrl.cxx (revision f6e50924346d0b8c0b07c91832a97665dd718b0c)
1*f6e50924SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*f6e50924SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*f6e50924SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*f6e50924SAndrew Rist  * distributed with this work for additional information
6*f6e50924SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*f6e50924SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*f6e50924SAndrew Rist  * "License"); you may not use this file except in compliance
9*f6e50924SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*f6e50924SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*f6e50924SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*f6e50924SAndrew Rist  * software distributed under the License is distributed on an
15*f6e50924SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*f6e50924SAndrew Rist  * KIND, either express or implied.  See the License for the
17*f6e50924SAndrew Rist  * specific language governing permissions and limitations
18*f6e50924SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*f6e50924SAndrew Rist  *************************************************************/
21*f6e50924SAndrew Rist 
22*f6e50924SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_svx.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir // include ---------------------------------------------------------------
28cdf0e10cSrcweir 
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include <vcl/bitmap.hxx>
31cdf0e10cSrcweir #include <editeng/frmdiritem.hxx>
32cdf0e10cSrcweir #include <svx/pageitem.hxx>
33cdf0e10cSrcweir #include <svx/pagectrl.hxx>
34cdf0e10cSrcweir #include <editeng/boxitem.hxx>
35cdf0e10cSrcweir 
36cdf0e10cSrcweir #include <algorithm>
37cdf0e10cSrcweir 
38cdf0e10cSrcweir // struct PageWindow_Impl ------------------------------------------------
39cdf0e10cSrcweir 
40cdf0e10cSrcweir struct PageWindow_Impl
41cdf0e10cSrcweir {
42cdf0e10cSrcweir     SvxBoxItem*     pBorder;
43cdf0e10cSrcweir     Bitmap          aBitmap;
44cdf0e10cSrcweir     FASTBOOL        bBitmap;
45cdf0e10cSrcweir     sal_Bool        bResetBackground;
46cdf0e10cSrcweir     sal_Bool        bFrameDirection;
47cdf0e10cSrcweir     sal_Int32       nFrameDirection;
48cdf0e10cSrcweir 
49cdf0e10cSrcweir 
PageWindow_ImplPageWindow_Impl50cdf0e10cSrcweir     PageWindow_Impl() :
51cdf0e10cSrcweir         pBorder(0),
52cdf0e10cSrcweir         bBitmap(sal_False),
53cdf0e10cSrcweir         bResetBackground(sal_False),
54cdf0e10cSrcweir         bFrameDirection(sal_False),
55cdf0e10cSrcweir         nFrameDirection(0) {}
56cdf0e10cSrcweir 
EnableFrameDirectionPageWindow_Impl57cdf0e10cSrcweir     void        EnableFrameDirection(sal_Bool bEnable){bFrameDirection = bEnable;}
SetFrameDirectionPageWindow_Impl58cdf0e10cSrcweir     void        SetFrameDirection(sal_Int32 nDirection){nFrameDirection = nDirection;}
59cdf0e10cSrcweir 
60cdf0e10cSrcweir };
61cdf0e10cSrcweir 
62cdf0e10cSrcweir // STATIC DATA -----------------------------------------------------------
63cdf0e10cSrcweir 
64cdf0e10cSrcweir #define CELL_WIDTH      1600L
65cdf0e10cSrcweir #define CELL_HEIGHT      800L
66cdf0e10cSrcweir 
67cdf0e10cSrcweir // class SvxPageWindow ---------------------------------------------------
68cdf0e10cSrcweir 
SvxPageWindow(Window * pParent,const ResId & rId)69cdf0e10cSrcweir SvxPageWindow::SvxPageWindow( Window* pParent, const ResId& rId ) :
70cdf0e10cSrcweir 
71cdf0e10cSrcweir     Window( pParent, rId ),
72cdf0e10cSrcweir 
73cdf0e10cSrcweir     nTop        ( 0 ),
74cdf0e10cSrcweir     nBottom     ( 0 ),
75cdf0e10cSrcweir     nLeft       ( 0 ),
76cdf0e10cSrcweir     nRight      ( 0 ),
77cdf0e10cSrcweir     aColor      ( COL_TRANSPARENT ),
78cdf0e10cSrcweir     nHdLeft     ( 0 ),
79cdf0e10cSrcweir     nHdRight    ( 0 ),
80cdf0e10cSrcweir     nHdDist     ( 0 ),
81cdf0e10cSrcweir     nHdHeight   ( 0 ),
82cdf0e10cSrcweir     aHdColor    ( COL_TRANSPARENT ),
83cdf0e10cSrcweir     pHdBorder   ( 0 ),
84cdf0e10cSrcweir     nFtLeft     ( 0 ),
85cdf0e10cSrcweir     nFtRight    ( 0 ),
86cdf0e10cSrcweir     nFtDist     ( 0 ),
87cdf0e10cSrcweir     nFtHeight   ( 0 ),
88cdf0e10cSrcweir     aFtColor    ( COL_TRANSPARENT ),
89cdf0e10cSrcweir     pFtBorder   ( 0 ),
90cdf0e10cSrcweir     bFooter     ( sal_False ),
91cdf0e10cSrcweir     bHeader     ( sal_False ),
92cdf0e10cSrcweir     bTable      ( sal_False ),
93cdf0e10cSrcweir     bHorz       ( sal_False ),
94cdf0e10cSrcweir     bVert       ( sal_False ),
95cdf0e10cSrcweir     eUsage      ( SVX_PAGE_ALL )
96cdf0e10cSrcweir 
97cdf0e10cSrcweir {
98cdf0e10cSrcweir     pImpl = new PageWindow_Impl;
99cdf0e10cSrcweir 
100cdf0e10cSrcweir     // defaultmaessing in Twips rechnen
101cdf0e10cSrcweir     SetMapMode( MapMode( MAP_TWIP ) );
102cdf0e10cSrcweir     aWinSize = GetOutputSizePixel();
103cdf0e10cSrcweir     aWinSize.Height() -= 4;
104cdf0e10cSrcweir     aWinSize.Width() -= 4;
105cdf0e10cSrcweir 
106cdf0e10cSrcweir     aWinSize = PixelToLogic( aWinSize );
107cdf0e10cSrcweir     SetBackground();
108cdf0e10cSrcweir }
109cdf0e10cSrcweir 
110cdf0e10cSrcweir // -----------------------------------------------------------------------
111cdf0e10cSrcweir 
~SvxPageWindow()112cdf0e10cSrcweir SvxPageWindow::~SvxPageWindow()
113cdf0e10cSrcweir {
114cdf0e10cSrcweir     delete pImpl;
115cdf0e10cSrcweir     delete pHdBorder;
116cdf0e10cSrcweir     delete pFtBorder;
117cdf0e10cSrcweir }
118cdf0e10cSrcweir 
119cdf0e10cSrcweir // -----------------------------------------------------------------------
120cdf0e10cSrcweir 
Paint(const Rectangle &)121cdf0e10cSrcweir void __EXPORT SvxPageWindow::Paint( const Rectangle& )
122cdf0e10cSrcweir {
123cdf0e10cSrcweir     Fraction aXScale( aWinSize.Width(), std::max( (long) (aSize.Width() * 2 + aSize.Width() / 8), 1L ) );
124cdf0e10cSrcweir     Fraction aYScale( aWinSize.Height(), std::max( aSize.Height(), 1L ) );
125cdf0e10cSrcweir     MapMode aMapMode( GetMapMode() );
126cdf0e10cSrcweir 
127cdf0e10cSrcweir     if ( aYScale < aXScale )
128cdf0e10cSrcweir     {
129cdf0e10cSrcweir         aMapMode.SetScaleX( aYScale );
130cdf0e10cSrcweir         aMapMode.SetScaleY( aYScale );
131cdf0e10cSrcweir     }
132cdf0e10cSrcweir     else
133cdf0e10cSrcweir     {
134cdf0e10cSrcweir         aMapMode.SetScaleX( aXScale );
135cdf0e10cSrcweir         aMapMode.SetScaleY( aXScale );
136cdf0e10cSrcweir     }
137cdf0e10cSrcweir     SetMapMode( aMapMode );
138cdf0e10cSrcweir     Size aSz( PixelToLogic( GetSizePixel() ) );
139cdf0e10cSrcweir     long nYPos = ( aSz.Height() - aSize.Height() ) / 2;
140cdf0e10cSrcweir 
141cdf0e10cSrcweir     if ( eUsage == SVX_PAGE_ALL )
142cdf0e10cSrcweir     {
143cdf0e10cSrcweir         // alle Seiten gleich -> eine Seite malen
144cdf0e10cSrcweir         if ( aSize.Width() > aSize.Height() )
145cdf0e10cSrcweir         {
146cdf0e10cSrcweir             // Querformat in gleicher Gr"osse zeichnen
147cdf0e10cSrcweir             Fraction aX = aMapMode.GetScaleX();
148cdf0e10cSrcweir             Fraction aY = aMapMode.GetScaleY();
149cdf0e10cSrcweir             Fraction a2( 1.5 );
150cdf0e10cSrcweir             aX *= a2;
151cdf0e10cSrcweir             aY *= a2;
152cdf0e10cSrcweir             aMapMode.SetScaleX( aX );
153cdf0e10cSrcweir             aMapMode.SetScaleY( aY );
154cdf0e10cSrcweir             SetMapMode( aMapMode );
155cdf0e10cSrcweir             aSz = PixelToLogic( GetSizePixel() );
156cdf0e10cSrcweir             nYPos = ( aSz.Height() - aSize.Height() ) / 2;
157cdf0e10cSrcweir             long nXPos = ( aSz.Width() - aSize.Width() ) / 2;
158cdf0e10cSrcweir             DrawPage( Point( nXPos, nYPos ), sal_True, sal_True );
159cdf0e10cSrcweir         }
160cdf0e10cSrcweir         else
161cdf0e10cSrcweir             // Hochformat
162cdf0e10cSrcweir             DrawPage( Point( ( aSz.Width() - aSize.Width() ) / 2, nYPos ), sal_True, sal_True );
163cdf0e10cSrcweir     }
164cdf0e10cSrcweir     else
165cdf0e10cSrcweir     {
166cdf0e10cSrcweir         // Linke und rechte Seite unterschiedlich -> ggf. zwei Seiten malen
167cdf0e10cSrcweir         DrawPage( Point( 0, nYPos ), sal_False, (sal_Bool)( eUsage & SVX_PAGE_LEFT ) );
168cdf0e10cSrcweir         DrawPage( Point( aSize.Width() + aSize.Width() / 8, nYPos ), sal_True,
169cdf0e10cSrcweir                   (sal_Bool)( eUsage & SVX_PAGE_RIGHT ) );
170cdf0e10cSrcweir     }
171cdf0e10cSrcweir }
172cdf0e10cSrcweir 
173cdf0e10cSrcweir // -----------------------------------------------------------------------
DrawPage(const Point & rOrg,const sal_Bool bSecond,const sal_Bool bEnabled)174cdf0e10cSrcweir void SvxPageWindow::DrawPage( const Point& rOrg, const sal_Bool bSecond, const sal_Bool bEnabled )
175cdf0e10cSrcweir {
176cdf0e10cSrcweir     const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
177cdf0e10cSrcweir     const Color& rFieldColor = rStyleSettings.GetFieldColor();
178cdf0e10cSrcweir     const Color& rFieldTextColor = rStyleSettings.GetFieldTextColor();
179cdf0e10cSrcweir     const Color& rDisableColor = rStyleSettings.GetDisableColor();
180cdf0e10cSrcweir     const Color& rDlgColor = rStyleSettings.GetDialogColor();
181cdf0e10cSrcweir 
182cdf0e10cSrcweir     // background
183cdf0e10cSrcweir     if(!bSecond || pImpl->bResetBackground)
184cdf0e10cSrcweir     {
185cdf0e10cSrcweir         SetLineColor( Color(COL_TRANSPARENT) );
186cdf0e10cSrcweir         SetFillColor( rDlgColor );
187cdf0e10cSrcweir         Size winSize(GetOutputSize());
188cdf0e10cSrcweir         DrawRect( Rectangle( Point(0,0), winSize ) );
189cdf0e10cSrcweir 
190cdf0e10cSrcweir         if ( pImpl->bResetBackground )
191cdf0e10cSrcweir             pImpl->bResetBackground = sal_False;
192cdf0e10cSrcweir     }
193cdf0e10cSrcweir     SetLineColor( rFieldTextColor );
194cdf0e10cSrcweir     // Schatten
195cdf0e10cSrcweir     Size aTempSize = aSize;
196cdf0e10cSrcweir     // Seite
197cdf0e10cSrcweir     if ( !bEnabled )
198cdf0e10cSrcweir     {
199cdf0e10cSrcweir         SetFillColor( rDisableColor );
200cdf0e10cSrcweir         DrawRect( Rectangle( rOrg, aTempSize ) );
201cdf0e10cSrcweir         return;
202cdf0e10cSrcweir     }
203cdf0e10cSrcweir     SetFillColor( rFieldColor );
204cdf0e10cSrcweir     DrawRect( Rectangle( rOrg, aTempSize ) );
205cdf0e10cSrcweir 
206cdf0e10cSrcweir     // Border Top Bottom Left Right
207cdf0e10cSrcweir     Point aBegin( rOrg );
208cdf0e10cSrcweir     Point aEnd( rOrg );
209cdf0e10cSrcweir 
210cdf0e10cSrcweir     long nL = nLeft;
211cdf0e10cSrcweir     long nR = nRight;
212cdf0e10cSrcweir 
213cdf0e10cSrcweir     if ( eUsage == SVX_PAGE_MIRROR && !bSecond )
214cdf0e10cSrcweir     {
215cdf0e10cSrcweir         // f"ur gespiegelt drehen
216cdf0e10cSrcweir         nL = nRight;
217cdf0e10cSrcweir         nR = nLeft;
218cdf0e10cSrcweir     }
219cdf0e10cSrcweir 
220cdf0e10cSrcweir     Rectangle aRect;
221cdf0e10cSrcweir 
222cdf0e10cSrcweir     aRect.Left()  = rOrg.X() + nL;
223cdf0e10cSrcweir     aRect.Right() = rOrg.X() + aTempSize.Width() - nR;
224cdf0e10cSrcweir     aRect.Top()   = rOrg.Y() + nTop;
225cdf0e10cSrcweir     aRect.Bottom()= rOrg.Y() + aTempSize.Height() - nBottom;
226cdf0e10cSrcweir 
227cdf0e10cSrcweir     Rectangle aHdRect( aRect );
228cdf0e10cSrcweir     Rectangle aFtRect( aRect );
229cdf0e10cSrcweir 
230cdf0e10cSrcweir     if ( bHeader )
231cdf0e10cSrcweir     {
232cdf0e10cSrcweir         // ggf. Header anzeigen
233cdf0e10cSrcweir         aHdRect.Left() += nHdLeft;
234cdf0e10cSrcweir         aHdRect.Right() -= nHdRight;
235cdf0e10cSrcweir         aHdRect.Bottom() = aRect.Top() + nHdHeight;
236cdf0e10cSrcweir         aRect.Top() += nHdHeight + nHdDist;
237cdf0e10cSrcweir         SetFillColor( aHdColor );
238cdf0e10cSrcweir         DrawRect( aHdRect );
239cdf0e10cSrcweir     }
240cdf0e10cSrcweir 
241cdf0e10cSrcweir     if ( bFooter )
242cdf0e10cSrcweir     {
243cdf0e10cSrcweir         // ggf. Footer anzeigen
244cdf0e10cSrcweir         aFtRect.Left() += nFtLeft;
245cdf0e10cSrcweir         aFtRect.Right() -= nFtRight;
246cdf0e10cSrcweir         aFtRect.Top() = aRect.Bottom() - nFtHeight;
247cdf0e10cSrcweir         aRect.Bottom() -= nFtHeight + nFtDist;
248cdf0e10cSrcweir         SetFillColor( aFtColor );
249cdf0e10cSrcweir         DrawRect( aFtRect );
250cdf0e10cSrcweir     }
251cdf0e10cSrcweir 
252cdf0e10cSrcweir     // Body malen
253cdf0e10cSrcweir     SetFillColor( aColor );
254cdf0e10cSrcweir     if ( pImpl->bBitmap )
255cdf0e10cSrcweir     {
256cdf0e10cSrcweir         DrawRect( aRect );
257cdf0e10cSrcweir         Point aBmpPnt = aRect.TopLeft();
258cdf0e10cSrcweir         Size aBmpSiz = aRect.GetSize();
259cdf0e10cSrcweir         long nDeltaX = aBmpSiz.Width() / 15;
260cdf0e10cSrcweir         long nDeltaY = aBmpSiz.Height() / 15;
261cdf0e10cSrcweir         aBmpPnt.X() += nDeltaX;
262cdf0e10cSrcweir         aBmpPnt.Y() += nDeltaY;
263cdf0e10cSrcweir         aBmpSiz.Width() -= nDeltaX * 2;
264cdf0e10cSrcweir         aBmpSiz.Height() -= nDeltaY * 2;
265cdf0e10cSrcweir         DrawBitmap( aBmpPnt, aBmpSiz, pImpl->aBitmap );
266cdf0e10cSrcweir     }
267cdf0e10cSrcweir     else
268cdf0e10cSrcweir         DrawRect( aRect );
269cdf0e10cSrcweir 
270cdf0e10cSrcweir     if(pImpl->bFrameDirection && !bTable)
271cdf0e10cSrcweir     {
272cdf0e10cSrcweir        //pImpl->nFrameDirection
273cdf0e10cSrcweir         Point aPos;
274cdf0e10cSrcweir         Font aFont(GetFont());
275cdf0e10cSrcweir         const Size aSaveSize = aFont.GetSize();
276cdf0e10cSrcweir         Size aDrawSize( 0, aRect.GetHeight() / 6);
277cdf0e10cSrcweir         aFont.SetSize(aDrawSize);
278cdf0e10cSrcweir         SetFont(aFont);
279cdf0e10cSrcweir         String sText(String::CreateFromAscii("ABC"));
280cdf0e10cSrcweir         Point aMove(1, GetTextHeight());
281cdf0e10cSrcweir         sal_Unicode cArrow = 0x2193;
282cdf0e10cSrcweir         long nAWidth = GetTextWidth(String(sText.GetChar(0)));
283cdf0e10cSrcweir         switch(pImpl->nFrameDirection)
284cdf0e10cSrcweir         {
285cdf0e10cSrcweir             case FRMDIR_HORI_LEFT_TOP:
286cdf0e10cSrcweir                 aPos = aRect.TopLeft();
287cdf0e10cSrcweir                 aPos.X() += PixelToLogic(Point(1,1)).X();
288cdf0e10cSrcweir                 aMove.Y() = 0;
289cdf0e10cSrcweir                 cArrow = 0x2192;
290cdf0e10cSrcweir             break;
291cdf0e10cSrcweir             case FRMDIR_HORI_RIGHT_TOP:
292cdf0e10cSrcweir                 aPos = aRect.TopRight();
293cdf0e10cSrcweir                 aPos.X() -= nAWidth;
294cdf0e10cSrcweir                 aMove.Y() = 0;
295cdf0e10cSrcweir                 aMove.X() *= -1;
296cdf0e10cSrcweir                 cArrow = 0x2190;
297cdf0e10cSrcweir             break;
298cdf0e10cSrcweir             case FRMDIR_VERT_TOP_LEFT:
299cdf0e10cSrcweir                 aPos = aRect.TopLeft();
300cdf0e10cSrcweir                 aPos.X() += PixelToLogic(Point(1,1)).X();
301cdf0e10cSrcweir                 aMove.X() = 0;
302cdf0e10cSrcweir             break;
303cdf0e10cSrcweir             case FRMDIR_VERT_TOP_RIGHT:
304cdf0e10cSrcweir                 aPos = aRect.TopRight();
305cdf0e10cSrcweir                 aPos.X() -= nAWidth;
306cdf0e10cSrcweir                 aMove.X() = 0;
307cdf0e10cSrcweir             break;
308cdf0e10cSrcweir         }
309cdf0e10cSrcweir         sText.Append(cArrow);
310cdf0e10cSrcweir         for(sal_uInt16 i = 0; i < sText.Len(); i++)
311cdf0e10cSrcweir         {
312cdf0e10cSrcweir             String sDraw(sText.GetChar(i));
313cdf0e10cSrcweir             long nHDiff = 0;
314cdf0e10cSrcweir             long nCharWidth = GetTextWidth(sDraw);
315cdf0e10cSrcweir             sal_Bool bHorizontal = 0 == aMove.Y();
316cdf0e10cSrcweir             if(!bHorizontal)
317cdf0e10cSrcweir             {
318cdf0e10cSrcweir                 nHDiff = (nAWidth - nCharWidth)/2;
319cdf0e10cSrcweir                 aPos.X() += nHDiff;
320cdf0e10cSrcweir             }
321cdf0e10cSrcweir             DrawText(aPos, sDraw);
322cdf0e10cSrcweir             if(bHorizontal)
323cdf0e10cSrcweir             {
324cdf0e10cSrcweir                 aPos.X() += aMove.X() < 0 ? - nCharWidth : nCharWidth;
325cdf0e10cSrcweir             }
326cdf0e10cSrcweir             else
327cdf0e10cSrcweir             {
328cdf0e10cSrcweir                 aPos.X() -= nHDiff;
329cdf0e10cSrcweir                 aPos.Y() += aMove.Y();
330cdf0e10cSrcweir             }
331cdf0e10cSrcweir         }
332cdf0e10cSrcweir         aFont.SetSize(aSaveSize);
333cdf0e10cSrcweir         SetFont(aFont);
334cdf0e10cSrcweir 
335cdf0e10cSrcweir     }
336cdf0e10cSrcweir     if ( bTable )
337cdf0e10cSrcweir     {
338cdf0e10cSrcweir         // Tabelle malen, ggf. zentrieren
339cdf0e10cSrcweir         SetLineColor( Color(COL_LIGHTGRAY) );
340cdf0e10cSrcweir 
341cdf0e10cSrcweir         long nW = aRect.GetWidth(), nH = aRect.GetHeight();
342cdf0e10cSrcweir         long nTW = CELL_WIDTH * 3, nTH = CELL_HEIGHT * 3;
343cdf0e10cSrcweir         long _nLeft = bHorz ? aRect.Left() + ((nW - nTW) / 2) : aRect.Left();
344cdf0e10cSrcweir         long _nTop = bVert ? aRect.Top() + ((nH - nTH) / 2) : aRect.Top();
345cdf0e10cSrcweir         Rectangle aCellRect( Point( _nLeft, _nTop ), Size( CELL_WIDTH, CELL_HEIGHT ) );
346cdf0e10cSrcweir 
347cdf0e10cSrcweir         for ( sal_uInt16 i = 0; i < 3; ++i )
348cdf0e10cSrcweir         {
349cdf0e10cSrcweir             aCellRect.Left() = _nLeft;
350cdf0e10cSrcweir             aCellRect.Right() = _nLeft + CELL_WIDTH;
351cdf0e10cSrcweir             if ( i > 0 )
352cdf0e10cSrcweir                 aCellRect.Move( 0, CELL_HEIGHT );
353cdf0e10cSrcweir 
354cdf0e10cSrcweir             for ( sal_uInt16 j = 0; j < 3; ++j )
355cdf0e10cSrcweir             {
356cdf0e10cSrcweir                 if ( j > 0 )
357cdf0e10cSrcweir                     aCellRect.Move( CELL_WIDTH, 0 );
358cdf0e10cSrcweir                 DrawRect( aCellRect );
359cdf0e10cSrcweir             }
360cdf0e10cSrcweir         }
361cdf0e10cSrcweir     }
362cdf0e10cSrcweir }
363cdf0e10cSrcweir 
364cdf0e10cSrcweir // -----------------------------------------------------------------------
365cdf0e10cSrcweir 
SetBorder(const SvxBoxItem & rNew)366cdf0e10cSrcweir void SvxPageWindow::SetBorder( const SvxBoxItem& rNew )
367cdf0e10cSrcweir {
368cdf0e10cSrcweir     delete pImpl->pBorder;
369cdf0e10cSrcweir     pImpl->pBorder = new SvxBoxItem( rNew );
370cdf0e10cSrcweir }
371cdf0e10cSrcweir 
372cdf0e10cSrcweir // -----------------------------------------------------------------------
373cdf0e10cSrcweir 
SetBitmap(Bitmap * pBmp)374cdf0e10cSrcweir void SvxPageWindow::SetBitmap( Bitmap* pBmp )
375cdf0e10cSrcweir {
376cdf0e10cSrcweir     if ( pBmp )
377cdf0e10cSrcweir     {
378cdf0e10cSrcweir         pImpl->aBitmap = *pBmp;
379cdf0e10cSrcweir         pImpl->bBitmap = sal_True;
380cdf0e10cSrcweir     }
381cdf0e10cSrcweir     else
382cdf0e10cSrcweir         pImpl->bBitmap = sal_False;
383cdf0e10cSrcweir }
384cdf0e10cSrcweir 
385cdf0e10cSrcweir // -----------------------------------------------------------------------
386cdf0e10cSrcweir 
SetHdBorder(const SvxBoxItem & rNew)387cdf0e10cSrcweir void SvxPageWindow::SetHdBorder( const SvxBoxItem& rNew )
388cdf0e10cSrcweir {
389cdf0e10cSrcweir     delete pHdBorder;
390cdf0e10cSrcweir     pHdBorder = new SvxBoxItem( rNew );
391cdf0e10cSrcweir }
392cdf0e10cSrcweir // -----------------------------------------------------------------------
393cdf0e10cSrcweir 
SetFtBorder(const SvxBoxItem & rNew)394cdf0e10cSrcweir void SvxPageWindow::SetFtBorder( const SvxBoxItem& rNew )
395cdf0e10cSrcweir {
396cdf0e10cSrcweir     delete pFtBorder;
397cdf0e10cSrcweir     pFtBorder = new SvxBoxItem( rNew );
398cdf0e10cSrcweir }
399cdf0e10cSrcweir /* -----------------------------13.06.2002 16:16------------------------------
400cdf0e10cSrcweir 
401cdf0e10cSrcweir  ---------------------------------------------------------------------------*/
EnableFrameDirection(sal_Bool bEnable)402cdf0e10cSrcweir void  SvxPageWindow::EnableFrameDirection(sal_Bool bEnable)
403cdf0e10cSrcweir {
404cdf0e10cSrcweir     pImpl->EnableFrameDirection(bEnable);
405cdf0e10cSrcweir }
406cdf0e10cSrcweir /* -----------------------------13.06.2002 16:16------------------------------
407cdf0e10cSrcweir 
408cdf0e10cSrcweir  ---------------------------------------------------------------------------*/
SetFrameDirection(sal_Int32 nFrameDirection)409cdf0e10cSrcweir void  SvxPageWindow::SetFrameDirection(sal_Int32 nFrameDirection)
410cdf0e10cSrcweir {
411cdf0e10cSrcweir     pImpl->SetFrameDirection(nFrameDirection);
412cdf0e10cSrcweir }
413cdf0e10cSrcweir 
ResetBackground()414cdf0e10cSrcweir void SvxPageWindow::ResetBackground()
415cdf0e10cSrcweir {
416cdf0e10cSrcweir     pImpl->bResetBackground = sal_True;
417cdf0e10cSrcweir }
418