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