LanguageTool: don't crash if REST protocol isn't set
[LibreOffice.git] / sc / inc / detdata.hxx
blobdb8e2f6cc4e9efa3719ed4fd245a20981379dba6
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 "global.hxx"
24 #include <memory>
25 #include <vector>
27 enum ScDetOpType
29 SCDETOP_ADDSUCC,
30 SCDETOP_DELSUCC,
31 SCDETOP_ADDPRED,
32 SCDETOP_DELPRED,
33 SCDETOP_ADDERROR
36 class ScDetOpData
38 ScAddress aPos;
39 ScDetOpType eOperation;
41 public:
42 ScDetOpData( const ScAddress& rP, ScDetOpType eOp ) :
43 aPos(rP), eOperation(eOp) {}
45 const ScAddress& GetPos() const { return aPos; }
46 ScDetOpType GetOperation() const { return eOperation; }
48 // for UpdateRef:
49 void SetPos(const ScAddress& rNew) { aPos=rNew; }
51 bool operator== ( const ScDetOpData& r ) const
52 { return eOperation == r.eOperation && aPos == r.aPos; }
55 // list of operators
57 typedef std::vector<ScDetOpData> ScDetOpDataVector;
59 class ScDetOpList
61 bool bHasAddError; // updated in append
62 ScDetOpDataVector aDetOpDataVector;
64 public:
65 ScDetOpList() : bHasAddError(false) {}
66 ScDetOpList(const ScDetOpList& rList);
68 void DeleteOnTab( SCTAB nTab );
69 void UpdateReference( const ScDocument* pDoc, UpdateRefMode eUpdateRefMode,
70 const ScRange& rRange, SCCOL nDx, SCROW nDy, SCTAB nDz );
72 bool operator==( const ScDetOpList& r ) const; // for ref-undo
74 void Append( const ScDetOpData& );
75 ScDetOpDataVector& GetDataVector() { return aDetOpDataVector; }
76 const ScDetOpData& GetObject( size_t nPos ) const;
78 bool HasAddError() const { return bHasAddError; }
79 size_t Count() const { return aDetOpDataVector.size(); }
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */