1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
23 #include <tools/gen.hxx>
24 #include "txttypes.hxx"
26 // Compared to the SV sizes SwPosSize is always positive
32 inline SwPosSize( const KSHORT nW
= 0, const KSHORT nH
= 0 )
33 : nWidth(nW
), nHeight(nH
) { }
34 inline SwPosSize( const Size
&rSize
)
35 : nWidth(KSHORT(rSize
.Width())), nHeight(KSHORT(rSize
.Height())){ }
36 inline KSHORT
Height() const { return nHeight
; }
37 inline void Height( const KSHORT nNew
) { nHeight
= nNew
; }
38 inline KSHORT
Width() const { return nWidth
; }
39 inline void Width( const KSHORT nNew
) { nWidth
= nNew
; }
41 inline Size
SvLSize() const { return Size( nWidth
, nHeight
); }
42 inline void SvLSize( const Size
&rSize
);
43 inline void SvXSize( const Size
&rSize
);
44 inline SwPosSize
&operator=( const SwPosSize
&rSize
);
45 inline SwPosSize
&operator=( const Size
&rSize
);
48 inline SwPosSize
&SwPosSize::operator=(const SwPosSize
&rSize
)
50 nWidth
= rSize
.Width();
51 nHeight
= rSize
.Height();
55 inline void SwPosSize::SvLSize( const Size
&rSize
)
57 nWidth
= KSHORT(rSize
.Width());
58 nHeight
= KSHORT(rSize
.Height());
61 inline void SwPosSize::SvXSize( const Size
&rSize
)
63 nHeight
= KSHORT(rSize
.Width());
64 nWidth
= KSHORT(rSize
.Height());
67 inline SwPosSize
&SwPosSize::operator=( const Size
&rSize
)
69 nWidth
= KSHORT(rSize
.Width());
70 nHeight
= KSHORT(rSize
.Height());
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */