Avoid potential negative array index access to cached text.
[LibreOffice.git] / sc / inc / poolcach.hxx
blob6e3c3deda9163ec4f4bebe06b6d06ed309556d4d
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 .
19 #pragma once
21 #include "scdllapi.h"
22 #include <vector>
24 class SfxItemPool;
25 class SfxItemSet;
26 class SfxPoolItem;
27 class ScPatternAttr;
29 class ScItemPoolCache
31 struct SfxItemModifyImpl
33 const ScPatternAttr *pOrigItem;
34 ScPatternAttr *pPoolItem;
37 SfxItemPool *pPool;
38 std::vector<SfxItemModifyImpl>
39 m_aCache;
40 const SfxItemSet *pSetToPut;
41 const SfxPoolItem *pItemToPut;
43 public:
44 ScItemPoolCache( SfxItemPool *pPool,
45 const SfxPoolItem *pPutItem );
46 ScItemPoolCache( SfxItemPool *pPool,
47 const SfxItemSet *pPutSet );
48 ~ScItemPoolCache();
50 const ScPatternAttr& ApplyTo( const ScPatternAttr& rSetItem );
53 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */