Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include <basegfx/tuple/b2ituple.hxx>
30 : : #include <basegfx/tuple/b2dtuple.hxx>
31 : : #include <rtl/instance.hxx>
32 : :
33 : : namespace { struct EmptyTuple : public rtl::Static<basegfx::B2ITuple, EmptyTuple> {}; }
34 : :
35 : : namespace basegfx
36 : : {
37 : : // external operators
38 : : //////////////////////////////////////////////////////////////////////////
39 : :
40 : 6748664 : B2ITuple operator+(const B2ITuple& rTupA, const B2ITuple& rTupB)
41 : : {
42 : 6748664 : B2ITuple aSum(rTupA);
43 : 6748664 : aSum += rTupB;
44 : 6748664 : return aSum;
45 : : }
46 : :
47 : 9359006 : B2ITuple operator-(const B2ITuple& rTupA, const B2ITuple& rTupB)
48 : : {
49 : 9359006 : B2ITuple aSub(rTupA);
50 : 9359006 : aSub -= rTupB;
51 : 9359006 : return aSub;
52 : : }
53 : :
54 : 0 : B2ITuple operator/(const B2ITuple& rTupA, const B2ITuple& rTupB)
55 : : {
56 : 0 : B2ITuple aDiv(rTupA);
57 : 0 : aDiv /= rTupB;
58 : 0 : return aDiv;
59 : : }
60 : :
61 : 0 : B2ITuple operator*(const B2ITuple& rTupA, const B2ITuple& rTupB)
62 : : {
63 : 0 : B2ITuple aMul(rTupA);
64 : 0 : aMul *= rTupB;
65 : 0 : return aMul;
66 : : }
67 : :
68 : 0 : B2ITuple operator*(const B2ITuple& rTup, sal_Int32 t)
69 : : {
70 : 0 : B2ITuple aNew(rTup);
71 : 0 : aNew *= t;
72 : 0 : return aNew;
73 : : }
74 : :
75 : 0 : B2ITuple operator*(sal_Int32 t, const B2ITuple& rTup)
76 : : {
77 : 0 : B2ITuple aNew(rTup);
78 : 0 : aNew *= t;
79 : 0 : return aNew;
80 : : }
81 : :
82 : 0 : B2ITuple operator/(const B2ITuple& rTup, sal_Int32 t)
83 : : {
84 : 0 : B2ITuple aNew(rTup);
85 : 0 : aNew /= t;
86 : 0 : return aNew;
87 : : }
88 : :
89 : 0 : B2ITuple operator/(sal_Int32 t, const B2ITuple& rTup)
90 : : {
91 : 0 : B2ITuple aNew(t, t);
92 : 0 : B2ITuple aTmp(rTup);
93 : 0 : aNew /= aTmp;
94 : 0 : return aNew;
95 : : }
96 : :
97 : : } // end of namespace basegfx
98 : :
99 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|