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/.
10 #undef SC_DLLIMPLEMENTATION
13 #include "tpcompatibility.hxx"
15 #include "scresid.hxx"
16 #include "appoptio.hxx"
18 ScTpCompatOptions::ScTpCompatOptions(vcl::Window
*pParent
, const SfxItemSet
&rCoreAttrs
) :
19 SfxTabPage(pParent
, "OptCompatibilityPage","modules/scalc/ui/optcompatibilitypage.ui", &rCoreAttrs
)
21 get(m_pLbKeyBindings
,"keybindings");
24 ScTpCompatOptions::~ScTpCompatOptions()
29 void ScTpCompatOptions::dispose()
31 m_pLbKeyBindings
.clear();
32 SfxTabPage::dispose();
35 VclPtr
<SfxTabPage
> ScTpCompatOptions::Create(vcl::Window
*pParent
, const SfxItemSet
*rCoreAttrs
)
37 return VclPtr
<ScTpCompatOptions
>::Create(pParent
, *rCoreAttrs
);
40 bool ScTpCompatOptions::FillItemSet(SfxItemSet
*rCoreAttrs
)
43 if (m_pLbKeyBindings
->IsValueChangedFromSaved())
47 SID_SC_OPT_KEY_BINDING_COMPAT
, m_pLbKeyBindings
->GetSelectEntryPos()));
53 void ScTpCompatOptions::Reset(const SfxItemSet
*rCoreAttrs
)
55 const SfxPoolItem
* pItem
;
56 if (rCoreAttrs
->HasItem(SID_SC_OPT_KEY_BINDING_COMPAT
, &pItem
))
58 const SfxUInt16Item
* p16Item
= static_cast<const SfxUInt16Item
*>(pItem
);
59 ScOptionsUtil::KeyBindingType eKeyB
=
60 static_cast<ScOptionsUtil::KeyBindingType
>(p16Item
->GetValue());
64 case ScOptionsUtil::KEY_DEFAULT
:
65 m_pLbKeyBindings
->SelectEntryPos(0);
67 case ScOptionsUtil::KEY_OOO_LEGACY
:
68 m_pLbKeyBindings
->SelectEntryPos(1);
75 m_pLbKeyBindings
->SaveValue();
78 SfxTabPage::sfxpg
ScTpCompatOptions::DeactivatePage(SfxItemSet
* /*pSet*/)
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */