Avoid potential negative array index access to cached text.
[LibreOffice.git] / embedserv / source / inc / embeddocaccess.hxx
blob0a84b92c2cbe5dfb78b7b6e0ab4789f97b4e2c99
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 #define OLESERV_SAVEOBJECT 1
23 #define OLESERV_CLOSE 2
24 #define OLESERV_NOTIFY 3
25 #define OLESERV_NOTIFYCLOSING 4
26 #define OLESERV_SHOWOBJECT 5
27 #define OLESERV_DEACTIVATE 6
29 #include <oleidl.h>
30 #if defined __clang__
31 #pragma clang diagnostic push
32 #pragma clang diagnostic ignored "-Wall"
33 #pragma clang diagnostic ignored "-Wextra"
34 #pragma clang diagnostic ignored "-Wmicrosoft"
35 #endif
36 #include <atldbcli.h>
37 #if defined __clang__
38 #pragma clang diagnostic pop
39 #endif
40 #include <cppuhelper/weak.hxx>
42 class EmbedDocument_Impl;
43 struct LockedEmbedDocument_Impl
45 private:
46 EmbedDocument_Impl* m_pEmbedDocument;
48 public:
49 LockedEmbedDocument_Impl();
50 LockedEmbedDocument_Impl( EmbedDocument_Impl* pEmbedDocument );
51 LockedEmbedDocument_Impl( const LockedEmbedDocument_Impl& aDocLock );
53 ~LockedEmbedDocument_Impl();
55 LockedEmbedDocument_Impl& operator=( const LockedEmbedDocument_Impl& aDocLock );
57 EmbedDocument_Impl* GetEmbedDocument() { return m_pEmbedDocument; }
59 void ExecuteMethod( sal_Int16 nId );
62 class EmbeddedDocumentInstanceAccess_Impl : public ::cppu::OWeakObject
64 ::osl::Mutex m_aMutex;
65 EmbedDocument_Impl* m_pEmbedDocument;
67 public:
68 EmbeddedDocumentInstanceAccess_Impl( EmbedDocument_Impl* pDoc )
69 : m_pEmbedDocument( pDoc )
72 LockedEmbedDocument_Impl GetEmbedDocument();
73 void ClearEmbedDocument();
76 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */