Avoid potential negative array index access to cached text.
[LibreOffice.git] / sc / inc / inputopt.hxx
blobaa4b4078e5dfed57118e16447ae7d56ee2fb0c07
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/.
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 .
20 #pragma once
22 #include <unotools/configitem.hxx>
24 class ScInputOptions
26 private:
27 sal_uInt16 nMoveDir; // enum ScDirection
28 bool bMoveSelection;
29 bool bMoveKeepEdit;
30 bool bEnterEdit;
31 bool bExtendFormat;
32 bool bRangeFinder;
33 bool bExpandRefs;
34 bool mbSortRefUpdate;
35 bool bMarkHeader;
36 bool bUseTabCol;
37 bool bTextWysiwyg;
38 bool bReplCellsWarn;
39 bool bLegacyCellSelection;
40 bool bEnterPasteMode;
42 public:
43 ScInputOptions();
45 void SetMoveDir(sal_uInt16 nNew) { nMoveDir = nNew; }
46 sal_uInt16 GetMoveDir() const { return nMoveDir; }
47 void SetMoveSelection(bool bSet) { bMoveSelection = bSet; }
48 bool GetMoveSelection() const { return bMoveSelection; }
49 void SetEnterEdit(bool bSet) { bEnterEdit = bSet; }
50 bool GetEnterEdit() const { return bEnterEdit; }
51 void SetMoveKeepEdit(bool bSet) { bMoveKeepEdit = bSet; }
52 bool GetMoveKeepEdit() const { return bMoveKeepEdit; }
53 void SetExtendFormat(bool bSet) { bExtendFormat = bSet; }
54 bool GetExtendFormat() const { return bExtendFormat; }
55 void SetRangeFinder(bool bSet) { bRangeFinder = bSet; }
56 bool GetRangeFinder() const { return bRangeFinder; }
57 void SetExpandRefs(bool bSet) { bExpandRefs = bSet; }
58 bool GetExpandRefs() const { return bExpandRefs; }
59 void SetSortRefUpdate(bool bSet) { mbSortRefUpdate = bSet; }
60 bool GetSortRefUpdate() const { return mbSortRefUpdate; }
61 void SetMarkHeader(bool bSet) { bMarkHeader = bSet; }
62 bool GetMarkHeader() const { return bMarkHeader; }
63 void SetUseTabCol(bool bSet) { bUseTabCol = bSet; }
64 bool GetUseTabCol() const { return bUseTabCol; }
65 void SetTextWysiwyg(bool bSet) { bTextWysiwyg = bSet; }
66 bool GetTextWysiwyg() const { return bTextWysiwyg; }
67 void SetReplaceCellsWarn(bool bSet) { bReplCellsWarn = bSet; }
68 bool GetReplaceCellsWarn() const { return bReplCellsWarn; }
69 void SetLegacyCellSelection(bool bSet) { bLegacyCellSelection = bSet; }
70 bool GetLegacyCellSelection() const { return bLegacyCellSelection; }
71 void SetEnterPasteMode(bool bSet) { bEnterPasteMode = bSet; }
72 bool GetEnterPasteMode() const { return bEnterPasteMode; }
75 // CfgItem for input options
77 class ScInputCfg final : private ScInputOptions,
78 public utl::ConfigItem
80 static css::uno::Sequence<OUString> GetPropertyNames();
81 void ReadCfg();
82 virtual void ImplCommit() override;
84 public:
85 ScInputCfg();
87 const ScInputOptions& GetOptions() const { return *this; }
88 void SetOptions( const ScInputOptions& rNew );
90 virtual void Notify( const css::uno::Sequence<OUString>& aPropertyNames ) override;
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */