fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / ui / optdlg / tpcompatibility.cxx
blob3c83b980b7aafffa7d69a62eaed770218948b99f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
10 #undef SC_DLLIMPLEMENTATION
12 #include <scmod.hxx>
13 #include "tpcompatibility.hxx"
14 #include "sc.hrc"
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()
26 disposeOnce();
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)
42 bool bRet = false;
43 if (m_pLbKeyBindings->IsValueChangedFromSaved())
45 rCoreAttrs->Put(
46 SfxUInt16Item(
47 SID_SC_OPT_KEY_BINDING_COMPAT, m_pLbKeyBindings->GetSelectEntryPos()));
48 bRet = true;
50 return bRet;
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());
62 switch (eKeyB)
64 case ScOptionsUtil::KEY_DEFAULT:
65 m_pLbKeyBindings->SelectEntryPos(0);
66 break;
67 case ScOptionsUtil::KEY_OOO_LEGACY:
68 m_pLbKeyBindings->SelectEntryPos(1);
69 break;
70 default:
75 m_pLbKeyBindings->SaveValue();
78 SfxTabPage::sfxpg ScTpCompatOptions::DeactivatePage(SfxItemSet* /*pSet*/)
80 return KEEP_PAGE;
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */