1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20 #include <svx/SpellDialogChildWindow.hxx>
21
22 #include <svx/svxdlg.hxx>
23 #include <osl/diagnose.h>
24
25 namespace svx {
26
27
SpellDialogChildWindow(vcl::Window * _pParent,sal_uInt16 nId,SfxBindings * pBindings)28 SpellDialogChildWindow::SpellDialogChildWindow (
29 vcl::Window* _pParent,
30 sal_uInt16 nId,
31 SfxBindings* pBindings)
32 : SfxChildWindow (_pParent, nId)
33 {
34 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
35 m_xAbstractSpellDialog = pFact->CreateSvxSpellDialog(_pParent->GetFrameWeld(),
36 pBindings,
37 this );
38 SetController(m_xAbstractSpellDialog->GetController());
39 SetHideNotDelete(true);
40 }
41
~SpellDialogChildWindow()42 SpellDialogChildWindow::~SpellDialogChildWindow()
43 {
44 m_xAbstractSpellDialog.disposeAndClear();
45 }
46
GetBindings() const47 SfxBindings& SpellDialogChildWindow::GetBindings() const
48 {
49 assert(m_xAbstractSpellDialog);
50 return m_xAbstractSpellDialog->GetBindings();
51 }
52
InvalidateSpellDialog()53 void SpellDialogChildWindow::InvalidateSpellDialog()
54 {
55 OSL_ASSERT (m_xAbstractSpellDialog);
56 if (m_xAbstractSpellDialog)
57 m_xAbstractSpellDialog->InvalidateDialog();
58 }
59
HasAutoCorrection()60 bool SpellDialogChildWindow::HasAutoCorrection()
61 {
62 return false;
63 }
64
AddAutoCorrection(const OUString &,const OUString &,LanguageType)65 void SpellDialogChildWindow::AddAutoCorrection(
66 const OUString& /*rOld*/,
67 const OUString& /*rNew*/,
68 LanguageType /*eLanguage*/)
69 {
70 OSL_FAIL("AutoCorrection should have been overridden - if available");
71 }
72
HasGrammarChecking()73 bool SpellDialogChildWindow::HasGrammarChecking()
74 {
75 return false;
76 }
77
IsGrammarChecking()78 bool SpellDialogChildWindow::IsGrammarChecking()
79 {
80 OSL_FAIL("Grammar checking should have been overridden - if available");
81 return false;
82 }
83
SetGrammarChecking(bool)84 void SpellDialogChildWindow::SetGrammarChecking(bool )
85 {
86 OSL_FAIL("Grammar checking should have been overridden - if available");
87 }
88 } // end of namespace ::svx
89
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
91