Avoid potential negative array index access to cached text.
[LibreOffice.git] / chart2 / source / inc / chartview / DrawModelWrapper.hxx
blob080587e7ecfeeaf73557a4cef95c6a47bf7ccdcf
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 <svx/svdmodel.hxx>
22 #include <svx/unopage.hxx>
23 #include <svx/unoshape.hxx>
24 #include <chartview/chartviewdllapi.hxx>
26 namespace com::sun::star::lang { class XMultiServiceFactory; }
27 namespace com::sun::star::frame { class XModel; }
28 namespace com::sun::star::drawing { class XDrawPage; }
29 namespace com::sun::star::drawing { class XShape; }
30 namespace com::sun::star::drawing { class XShapes; }
32 class SdrObjList;
33 class SdrObject;
35 namespace chart
38 class OOO_DLLPUBLIC_CHARTVIEW DrawModelWrapper final : private SdrModel
40 private:
41 rtl::Reference<SvxDrawPage> m_xMainDrawPage;
42 rtl::Reference<SvxDrawPage> m_xHiddenDrawPage;
43 rtl::Reference<SfxItemPool> m_xChartItemPool;
44 VclPtr<OutputDevice> m_pRefDevice;
46 public:
47 SAL_DLLPRIVATE DrawModelWrapper();
48 SAL_DLLPRIVATE virtual ~DrawModelWrapper() override;
50 css::uno::Reference< css::lang::XMultiServiceFactory > getShapeFactory();
52 // the main page will contain the normal view objects
53 const rtl::Reference<SvxDrawPage> & getMainDrawPage();
54 SAL_DLLPRIVATE void clearMainDrawPage();
56 // the extra page is not visible, but contains some extras like the symbols for data points
57 const rtl::Reference<SvxDrawPage> & getHiddenDrawPage();
59 static rtl::Reference<SvxShapeGroupAnyD>
60 getChartRootShape( const rtl::Reference<SvxDrawPage>& xPage );
62 SAL_DLLPRIVATE void lockControllers();
63 SAL_DLLPRIVATE void unlockControllers();
65 OutputDevice* getReferenceDevice() const;
67 SfxItemPool& GetItemPool();
69 SAL_DLLPRIVATE virtual css::uno::Reference< css::frame::XModel >
70 createUnoModel() override;
71 SAL_DLLPRIVATE css::uno::Reference< css::frame::XModel >
72 getUnoModel();
73 SdrModel& getSdrModel();
75 XColorListRef GetColorList() const;
76 XDashListRef GetDashList() const;
77 XLineEndListRef GetLineEndList() const;
78 XGradientListRef GetGradientList() const;
79 XHatchListRef GetHatchList() const;
80 XBitmapListRef GetBitmapList() const;
81 XPatternListRef GetPatternList() const;
83 SdrObject* getNamedSdrObject( const OUString& rName );
84 static SdrObject* getNamedSdrObject( const OUString& rName, SdrObjList const * pObjList );
86 static bool removeShape( const rtl::Reference<SvxShape>& xShape );
88 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
90 } //namespace chart
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */