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 .
20 #include <uielement/uielement.hxx>
22 #include <com/sun/star/ui/DockingArea.hpp>
24 using namespace ::com::sun::star
;
29 bool UIElement::operator< ( const ::framework::UIElement
& aUIElement
) const
31 if ( !m_xUIElement
.is() && aUIElement
.m_xUIElement
.is() )
33 else if ( m_xUIElement
.is() && !aUIElement
.m_xUIElement
.is() )
35 else if ( !m_bVisible
&& aUIElement
.m_bVisible
)
37 else if ( m_bVisible
&& !aUIElement
.m_bVisible
)
39 else if ( !m_bFloating
&& aUIElement
.m_bFloating
)
41 else if ( m_bFloating
&& !aUIElement
.m_bFloating
)
47 bool bEqual
= ( m_aFloatingData
.m_aPos
.Y
== aUIElement
.m_aFloatingData
.m_aPos
.Y
);
49 return ( m_aFloatingData
.m_aPos
.X
< aUIElement
.m_aFloatingData
.m_aPos
.X
);
51 return ( m_aFloatingData
.m_aPos
.Y
< aUIElement
.m_aFloatingData
.m_aPos
.Y
);
55 if ( m_aDockedData
.m_nDockedArea
< aUIElement
.m_aDockedData
.m_nDockedArea
)
57 else if ( m_aDockedData
.m_nDockedArea
> aUIElement
.m_aDockedData
.m_nDockedArea
)
61 if ( m_aDockedData
.m_nDockedArea
== ui::DockingArea_DOCKINGAREA_TOP
||
62 m_aDockedData
.m_nDockedArea
== ui::DockingArea_DOCKINGAREA_BOTTOM
)
64 if ( m_aDockedData
.m_aPos
.Y
!= aUIElement
.m_aDockedData
.m_aPos
.Y
)
65 return ( m_aDockedData
.m_aPos
.Y
< aUIElement
.m_aDockedData
.m_aPos
.Y
);
68 bool bEqual
= ( m_aDockedData
.m_aPos
.X
== aUIElement
.m_aDockedData
.m_aPos
.X
);
71 return m_bUserActive
&& !aUIElement
.m_bUserActive
;
74 return ( m_aDockedData
.m_aPos
.X
<= aUIElement
.m_aDockedData
.m_aPos
.X
);
79 if ( m_aDockedData
.m_aPos
.X
!= aUIElement
.m_aDockedData
.m_aPos
.X
)
80 return ( m_aDockedData
.m_aPos
.X
< aUIElement
.m_aDockedData
.m_aPos
.X
);
83 bool bEqual
= ( m_aDockedData
.m_aPos
.Y
== aUIElement
.m_aDockedData
.m_aPos
.Y
);
86 return m_bUserActive
&& !aUIElement
.m_bUserActive
;
89 return ( m_aDockedData
.m_aPos
.Y
<= aUIElement
.m_aDockedData
.m_aPos
.Y
);
97 } // namespace framework
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */