1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: possiz.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
34 #include <tools/gen.hxx>
35 #include "txttypes.hxx"
37 // Im Gegensazt zu den SV-Sizes ist die SwPosSize immer positiv
43 inline SwPosSize( const KSHORT nW
= 0, const KSHORT nH
= 0 )
44 : nWidth(nW
), nHeight(nH
) { }
45 inline SwPosSize( const Size
&rSize
)
46 : nWidth(KSHORT(rSize
.Width())), nHeight(KSHORT(rSize
.Height())){ }
47 inline KSHORT
Height() const { return nHeight
; }
48 inline void Height( const KSHORT nNew
) { nHeight
= nNew
; }
49 inline KSHORT
Width() const { return nWidth
; }
50 inline void Width( const KSHORT nNew
) { nWidth
= nNew
; }
52 inline Size
SvLSize() const { return Size( nWidth
, nHeight
); }
53 inline void SvLSize( const Size
&rSize
);
54 inline void SvXSize( const Size
&rSize
);
55 inline SwPosSize
&operator=( const SwPosSize
&rSize
);
56 inline SwPosSize
&operator=( const Size
&rSize
);
59 inline SwPosSize
&SwPosSize::operator=(const SwPosSize
&rSize
)
61 nWidth
= rSize
.Width();
62 nHeight
= rSize
.Height();
66 inline void SwPosSize::SvLSize( const Size
&rSize
)
68 nWidth
= KSHORT(rSize
.Width());
69 nHeight
= KSHORT(rSize
.Height());
72 inline void SwPosSize::SvXSize( const Size
&rSize
)
74 nHeight
= KSHORT(rSize
.Width());
75 nWidth
= KSHORT(rSize
.Height());
78 inline SwPosSize
&SwPosSize::operator=( const Size
&rSize
)
80 nWidth
= KSHORT(rSize
.Width());
81 nHeight
= KSHORT(rSize
.Height());