1*2ee96f1cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*2ee96f1cSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*2ee96f1cSAndrew Rist * or more contributor license agreements. See the NOTICE file
5*2ee96f1cSAndrew Rist * distributed with this work for additional information
6*2ee96f1cSAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*2ee96f1cSAndrew Rist * to you under the Apache License, Version 2.0 (the
8*2ee96f1cSAndrew Rist * "License"); you may not use this file except in compliance
9*2ee96f1cSAndrew Rist * with the License. You may obtain a copy of the License at
10*2ee96f1cSAndrew Rist *
11*2ee96f1cSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*2ee96f1cSAndrew Rist *
13*2ee96f1cSAndrew Rist * Unless required by applicable law or agreed to in writing,
14*2ee96f1cSAndrew Rist * software distributed under the License is distributed on an
15*2ee96f1cSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*2ee96f1cSAndrew Rist * KIND, either express or implied. See the License for the
17*2ee96f1cSAndrew Rist * specific language governing permissions and limitations
18*2ee96f1cSAndrew Rist * under the License.
19*2ee96f1cSAndrew Rist *
20*2ee96f1cSAndrew Rist *************************************************************/
21*2ee96f1cSAndrew Rist
22*2ee96f1cSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_cui.hxx"
26cdf0e10cSrcweir
27cdf0e10cSrcweir #include <SpellAttrib.hxx>
28cdf0e10cSrcweir #include <vcl/font.hxx>
29cdf0e10cSrcweir #include <com/sun/star/uno/Reference.hxx>
30cdf0e10cSrcweir #include <com/sun/star/linguistic2/XSpellAlternatives.hpp>
31cdf0e10cSrcweir using namespace svx;
32cdf0e10cSrcweir using namespace com::sun::star::linguistic2;
33cdf0e10cSrcweir using namespace com::sun::star::uno;
34cdf0e10cSrcweir
35cdf0e10cSrcweir /*-- 26.06.2008 10:41:57---------------------------------------------------
36cdf0e10cSrcweir
37cdf0e10cSrcweir -----------------------------------------------------------------------*/
SpellErrorAttrib(const SpellErrorDescription & rDesc)38cdf0e10cSrcweir SpellErrorAttrib::SpellErrorAttrib( const SpellErrorDescription& rDesc ) :
39cdf0e10cSrcweir TextAttrib(TEXTATTR_SPELL_ERROR),
40cdf0e10cSrcweir m_aSpellErrorDescription( rDesc )
41cdf0e10cSrcweir {
42cdf0e10cSrcweir }
43cdf0e10cSrcweir
44cdf0e10cSrcweir /*-- 10.09.2003 12:54:34---------------------------------------------------
45cdf0e10cSrcweir
46cdf0e10cSrcweir -----------------------------------------------------------------------*/
SpellErrorAttrib(const SpellErrorAttrib & rAttr)47cdf0e10cSrcweir SpellErrorAttrib::SpellErrorAttrib( const SpellErrorAttrib& rAttr ) :
48cdf0e10cSrcweir TextAttrib(TEXTATTR_SPELL_ERROR),
49cdf0e10cSrcweir m_aSpellErrorDescription( rAttr.m_aSpellErrorDescription )
50cdf0e10cSrcweir {
51cdf0e10cSrcweir }
52cdf0e10cSrcweir /*-- 10.09.2003 12:54:34---------------------------------------------------
53cdf0e10cSrcweir
54cdf0e10cSrcweir -----------------------------------------------------------------------*/
~SpellErrorAttrib()55cdf0e10cSrcweir SpellErrorAttrib::~SpellErrorAttrib()
56cdf0e10cSrcweir {
57cdf0e10cSrcweir }
58cdf0e10cSrcweir /*-- 10.09.2003 12:54:35---------------------------------------------------
59cdf0e10cSrcweir
60cdf0e10cSrcweir -----------------------------------------------------------------------*/
SetFont(Font &) const61cdf0e10cSrcweir void SpellErrorAttrib::SetFont( Font& ) const
62cdf0e10cSrcweir {
63cdf0e10cSrcweir //this attribute doesn't have a visual effect
64cdf0e10cSrcweir }
65cdf0e10cSrcweir /*-- 10.09.2003 12:54:35---------------------------------------------------
66cdf0e10cSrcweir
67cdf0e10cSrcweir -----------------------------------------------------------------------*/
Clone() const68cdf0e10cSrcweir TextAttrib* SpellErrorAttrib::Clone() const
69cdf0e10cSrcweir {
70cdf0e10cSrcweir return new SpellErrorAttrib(*this);
71cdf0e10cSrcweir }
72cdf0e10cSrcweir /*-- 10.09.2003 12:54:35---------------------------------------------------
73cdf0e10cSrcweir
74cdf0e10cSrcweir -----------------------------------------------------------------------*/
operator ==(const TextAttrib & rAttr) const75cdf0e10cSrcweir int SpellErrorAttrib::operator==( const TextAttrib& rAttr ) const
76cdf0e10cSrcweir {
77cdf0e10cSrcweir return Which() == rAttr.Which() &&
78cdf0e10cSrcweir m_aSpellErrorDescription == static_cast<const SpellErrorAttrib&>(rAttr).m_aSpellErrorDescription;
79cdf0e10cSrcweir }
80cdf0e10cSrcweir /*-- 10.09.2003 14:27:43---------------------------------------------------
81cdf0e10cSrcweir
82cdf0e10cSrcweir -----------------------------------------------------------------------*/
SpellLanguageAttrib(LanguageType eLang)83cdf0e10cSrcweir SpellLanguageAttrib::SpellLanguageAttrib(LanguageType eLang) :
84cdf0e10cSrcweir TextAttrib(TEXTATTR_SPELL_LANGUAGE),
85cdf0e10cSrcweir m_eLanguage(eLang)
86cdf0e10cSrcweir {
87cdf0e10cSrcweir }
88cdf0e10cSrcweir /*-- 10.09.2003 14:27:43---------------------------------------------------
89cdf0e10cSrcweir
90cdf0e10cSrcweir -----------------------------------------------------------------------*/
SpellLanguageAttrib(const SpellLanguageAttrib & rAttr)91cdf0e10cSrcweir SpellLanguageAttrib::SpellLanguageAttrib( const SpellLanguageAttrib& rAttr ) :
92cdf0e10cSrcweir TextAttrib(TEXTATTR_SPELL_LANGUAGE),
93cdf0e10cSrcweir m_eLanguage(rAttr.m_eLanguage)
94cdf0e10cSrcweir {
95cdf0e10cSrcweir }
96cdf0e10cSrcweir /*-- 10.09.2003 14:27:43---------------------------------------------------
97cdf0e10cSrcweir
98cdf0e10cSrcweir -----------------------------------------------------------------------*/
~SpellLanguageAttrib()99cdf0e10cSrcweir SpellLanguageAttrib::~SpellLanguageAttrib()
100cdf0e10cSrcweir {
101cdf0e10cSrcweir }
102cdf0e10cSrcweir /*-- 10.09.2003 14:27:43---------------------------------------------------
103cdf0e10cSrcweir
104cdf0e10cSrcweir -----------------------------------------------------------------------*/
SetFont(Font &) const105cdf0e10cSrcweir void SpellLanguageAttrib::SetFont( Font& ) const
106cdf0e10cSrcweir {
107cdf0e10cSrcweir //no visual effect
108cdf0e10cSrcweir }
109cdf0e10cSrcweir /*-- 10.09.2003 14:27:44---------------------------------------------------
110cdf0e10cSrcweir
111cdf0e10cSrcweir -----------------------------------------------------------------------*/
Clone() const112cdf0e10cSrcweir TextAttrib* SpellLanguageAttrib::Clone() const
113cdf0e10cSrcweir {
114cdf0e10cSrcweir return new SpellLanguageAttrib(*this);
115cdf0e10cSrcweir }
116cdf0e10cSrcweir /*-- 10.09.2003 14:27:44---------------------------------------------------
117cdf0e10cSrcweir
118cdf0e10cSrcweir -----------------------------------------------------------------------*/
operator ==(const TextAttrib & rAttr) const119cdf0e10cSrcweir int SpellLanguageAttrib::operator==( const TextAttrib& rAttr ) const
120cdf0e10cSrcweir {
121cdf0e10cSrcweir return Which() == rAttr.Which() &&
122cdf0e10cSrcweir m_eLanguage == static_cast<const SpellLanguageAttrib&>(rAttr).m_eLanguage;
123cdf0e10cSrcweir }
124cdf0e10cSrcweir /*-- 31.10.2003 16:07:45---------------------------------------------------
125cdf0e10cSrcweir
126cdf0e10cSrcweir -----------------------------------------------------------------------*/
SpellBackgroundAttrib(const Color & rCol)127cdf0e10cSrcweir SpellBackgroundAttrib::SpellBackgroundAttrib(const Color& rCol) :
128cdf0e10cSrcweir TextAttrib(TEXTATTR_SPELL_BACKGROUND),
129cdf0e10cSrcweir m_aBackgroundColor(rCol)
130cdf0e10cSrcweir {
131cdf0e10cSrcweir }
132cdf0e10cSrcweir /*-- 31.10.2003 16:07:45---------------------------------------------------
133cdf0e10cSrcweir
134cdf0e10cSrcweir -----------------------------------------------------------------------*/
SpellBackgroundAttrib(const SpellBackgroundAttrib & rAttr)135cdf0e10cSrcweir SpellBackgroundAttrib::SpellBackgroundAttrib( const SpellBackgroundAttrib& rAttr ) :
136cdf0e10cSrcweir TextAttrib(TEXTATTR_SPELL_BACKGROUND),
137cdf0e10cSrcweir m_aBackgroundColor(rAttr.m_aBackgroundColor)
138cdf0e10cSrcweir {
139cdf0e10cSrcweir }
140cdf0e10cSrcweir /*-- 31.10.2003 16:07:46---------------------------------------------------
141cdf0e10cSrcweir
142cdf0e10cSrcweir -----------------------------------------------------------------------*/
~SpellBackgroundAttrib()143cdf0e10cSrcweir SpellBackgroundAttrib::~SpellBackgroundAttrib()
144cdf0e10cSrcweir {
145cdf0e10cSrcweir }
146cdf0e10cSrcweir /*-- 31.10.2003 16:07:46---------------------------------------------------
147cdf0e10cSrcweir
148cdf0e10cSrcweir -----------------------------------------------------------------------*/
SetFont(Font & rFont) const149cdf0e10cSrcweir void SpellBackgroundAttrib::SetFont( Font& rFont ) const
150cdf0e10cSrcweir {
151cdf0e10cSrcweir rFont.SetFillColor(m_aBackgroundColor);
152cdf0e10cSrcweir }
153cdf0e10cSrcweir /*-- 31.10.2003 16:07:46---------------------------------------------------
154cdf0e10cSrcweir
155cdf0e10cSrcweir -----------------------------------------------------------------------*/
Clone() const156cdf0e10cSrcweir TextAttrib* SpellBackgroundAttrib::Clone() const
157cdf0e10cSrcweir {
158cdf0e10cSrcweir return new SpellBackgroundAttrib(*this);
159cdf0e10cSrcweir }
160cdf0e10cSrcweir /*-- 31.10.2003 16:07:47---------------------------------------------------
161cdf0e10cSrcweir
162cdf0e10cSrcweir -----------------------------------------------------------------------*/
operator ==(const TextAttrib & rAttr) const163cdf0e10cSrcweir int SpellBackgroundAttrib::operator==( const TextAttrib& rAttr ) const
164cdf0e10cSrcweir {
165cdf0e10cSrcweir return Which() == rAttr.Which() &&
166cdf0e10cSrcweir m_aBackgroundColor == static_cast<const SpellBackgroundAttrib&>(rAttr).m_aBackgroundColor;
167cdf0e10cSrcweir }
168cdf0e10cSrcweir
169