xref: /AOO41X/main/svx/source/svdraw/sdrcomment.cxx (revision f6e50924346d0b8c0b07c91832a97665dd718b0c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_svx.hxx"
26 #include <svx/sdrcomment.hxx>
27 
28 //////////////////////////////////////////////////////////////////////////////
29 
30 namespace sdr
31 {
Comment(sal_uInt32 nID,Date aCreationDate,const::rtl::OUString & rUserName,const::rtl::OUString & rText,const basegfx::B2DPoint & rPosition)32     Comment::Comment(
33         sal_uInt32 nID,
34         Date aCreationDate,
35         const ::rtl::OUString& rUserName,
36         const ::rtl::OUString& rText,
37         const basegfx::B2DPoint& rPosition)
38     :   mnID(nID),
39         maCreationDate(aCreationDate),
40         maUserName(rUserName),
41         maText(rText),
42         maPosition(rPosition)
43     {
44     }
45 
~Comment()46     Comment::~Comment()
47     {
48     }
49 
operator ==(const Comment & rCandidate) const50     sal_Bool Comment::operator==(const Comment& rCandidate) const
51     {
52         return (
53             mnID == rCandidate.mnID
54             && maCreationDate == rCandidate.maCreationDate
55             && maUserName == rCandidate.maUserName
56             && maText == rCandidate.maText
57             && maPosition == rCandidate.maPosition);
58     }
59 
SetCreationDate(Date aNewDate)60     void Comment::SetCreationDate(Date aNewDate)
61     {
62         if(aNewDate != maCreationDate)
63         {
64             maCreationDate = aNewDate;
65         }
66     }
67 
SetUserName(const::rtl::OUString & rNewName)68     void Comment::SetUserName(const ::rtl::OUString& rNewName)
69     {
70         if(rNewName != maUserName)
71         {
72             maUserName = rNewName;
73         }
74     }
75 
SetText(const::rtl::OUString & rNewText)76     void Comment::SetText(const ::rtl::OUString& rNewText)
77     {
78         if(rNewText != maText)
79         {
80             maText = rNewText;
81         }
82     }
83 
SetPosition(const basegfx::B2DPoint & rNewPos)84     void Comment::SetPosition(const basegfx::B2DPoint& rNewPos)
85     {
86         if(rNewPos != maPosition)
87         {
88             maPosition = rNewPos;
89         }
90     }
91 } // end of namespace sdr
92 
93 //////////////////////////////////////////////////////////////////////////////
94 // eof
95