Avoid potential negative array index access to cached text.
[LibreOffice.git] / writerperfect / qa / unit / WpftLoader.hxx
blob646e3a3b6aabe23d630696795b04fb4638392600
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/.
8 */
10 #pragma once
12 #include "wpftqahelperdllapi.h"
14 #include <com/sun/star/uno/Reference.hxx>
15 #include <com/sun/star/uno/Sequence.hxx>
17 #include <rtl/ustring.hxx>
19 namespace com
21 namespace sun
23 namespace star
25 namespace beans
27 struct PropertyValue;
29 namespace container
31 class XNameAccess;
33 namespace document
35 class XFilter;
37 namespace frame
39 class XDesktop2;
40 class XFrame;
42 namespace io
44 class XInputStream;
46 namespace lang
48 class XComponent;
50 namespace uno
52 class XComponentContext;
58 namespace writerperfect
60 namespace test
62 class WPFTQAHELPER_DLLPUBLIC WpftLoader
64 public:
65 WpftLoader(const OUString& rURL, const css::uno::Reference<css::document::XFilter>& rxFilter,
66 const OUString& rFactoryURL,
67 const css::uno::Reference<css::frame::XDesktop2>& rxDesktop,
68 const css::uno::Reference<css::container::XNameAccess>& rxTypeMap,
69 const css::uno::Reference<css::uno::XComponentContext>& rxContext);
70 WpftLoader(const css::uno::Reference<css::io::XInputStream>& rxInputStream,
71 const css::uno::Reference<css::document::XFilter>& rxFilter,
72 const OUString& rFactoryURL,
73 const css::uno::Reference<css::frame::XDesktop2>& rxDesktop,
74 const css::uno::Reference<css::uno::XComponentContext>& rxContext);
75 ~WpftLoader();
77 const css::uno::Reference<css::lang::XComponent>& getDocument() const;
79 private:
80 bool impl_load();
81 void impl_dispose();
83 void impl_detectFilterName(css::uno::Sequence<css::beans::PropertyValue>& rDescriptor,
84 const OUString& rTypeName);
86 private:
87 const OUString m_aURL;
88 const css::uno::Reference<css::io::XInputStream> m_xInputStream;
89 const OUString m_aFactoryURL;
90 const css::uno::Reference<css::document::XFilter> m_xFilter;
91 const css::uno::Reference<css::frame::XDesktop2> m_xDesktop;
92 const css::uno::Reference<css::container::XNameAccess> m_xTypeMap;
93 const css::uno::Reference<css::uno::XComponentContext> m_xContext;
94 css::uno::Reference<css::lang::XComponent> m_xDoc;
95 css::uno::Reference<css::frame::XFrame> m_xFrame;
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */