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 .
32 mbHasCalculate
= false;
36 void MIP::inherit( const MIP
& rMip
)
40 mbHasReadonly
= rMip
.mbHasReadonly
;
41 mbReadonly
= rMip
.isReadonly();
45 mbHasRequired
= rMip
.mbHasRequired
;
46 mbRequired
= rMip
.isRequired();
50 mbHasRelevant
= rMip
.mbHasRelevant
;
51 mbRelevant
= rMip
.isRelevant();
53 if( ! mbHasConstraint
)
55 mbHasConstraint
= rMip
.mbHasConstraint
;
56 mbConstraint
= rMip
.isConstraint();
57 msConstraintExplanation
= rMip
.getConstraintExplanation();
59 if( ! mbHasCalculate
)
61 mbHasCalculate
= rMip
.mbHasCalculate
;
65 mbHasTypeName
= rMip
.mbHasTypeName
;
66 msTypeName
= rMip
.getTypeName();
70 void MIP::join( const MIP
& rMip
)
72 // TODO: inherit only inheritable MIPs...
76 bool MIP::isReadonly() const { return mbHasReadonly
? mbReadonly
: mbHasCalculate
; }
77 void MIP::setReadonly( bool b
) { mbHasReadonly
= true; mbReadonly
= b
; }
78 void MIP::resetReadonly() { mbHasReadonly
= false; mbReadonly
= false; }
80 void MIP::setRequired( bool b
) { mbHasRequired
= true; mbRequired
= b
; }
81 void MIP::resetRequired() { mbHasRequired
= false; mbRequired
= false; }
83 void MIP::setRelevant( bool b
) { mbHasRelevant
= true; mbRelevant
= b
; }
84 void MIP::resetRelevant() { mbHasRelevant
= false; mbRelevant
= true; }
86 void MIP::setConstraint( bool b
) { mbHasConstraint
= true; mbConstraint
= b
; msConstraintExplanation
.clear(); }
87 void MIP::resetConstraint() { mbHasConstraint
= false; mbConstraint
= true; msConstraintExplanation
.clear(); }
89 void MIP::setConstraintExplanation( const OUString
& s
) { msConstraintExplanation
= s
; }
91 void MIP::setHasCalculate( bool b
) { mbHasCalculate
= b
; }
93 void MIP::setTypeName( const OUString
& s
) { msTypeName
= s
; mbHasTypeName
= true; }
94 void MIP::resetTypeName() { msTypeName
.clear(); mbHasTypeName
= false; }
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */