Avoid potential negative array index access to cached text.
[LibreOffice.git] / sfx2 / inc / guisaveas.hxx
bloba1f85bbc22483841f1011cd8206e212a3b314132
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 #ifndef INCLUDED_SFX2_INC_GUISAVEAS_HXX
21 #define INCLUDED_SFX2_INC_GUISAVEAS_HXX
23 #include <sal/config.h>
25 #include <string_view>
27 #include <com/sun/star/uno/Sequence.hxx>
28 #include <com/sun/star/beans/PropertyValue.hpp>
29 #include <com/sun/star/container/XNameAccess.hpp>
30 #include <com/sun/star/container/XContainerQuery.hpp>
31 #include <com/sun/star/frame/XModel.hpp>
32 #include <com/sun/star/frame/XModuleManager2.hpp>
34 #include <comphelper/sequenceashashmap.hxx>
36 #include <sfx2/bindings.hxx>
37 #include <sfx2/signaturestate.hxx>
39 #include <svtools/dialogclosedlistener.hxx>
41 #include <tools/urlobj.hxx>
44 namespace com::sun::star::document { class XDocumentProperties; }
46 namespace weld { class Window; }
47 class ModelData_Impl;
49 class SfxStoringHelper
51 friend class ModelData_Impl;
53 private:
54 css::uno::Reference< css::container::XNameAccess > m_xFilterCFG;
55 css::uno::Reference< css::container::XContainerQuery > m_xFilterQuery;
56 css::uno::Reference< css::frame::XModuleManager2 > m_xModuleManager;
58 std::shared_ptr<ModelData_Impl> m_xModelData;
59 css::uno::Sequence< css::beans::PropertyValue > m_aArgsSequence;
61 css::uno::Reference< css::container::XNameAccess > const & GetFilterConfiguration();
62 css::uno::Reference< css::container::XContainerQuery > const & GetFilterQuery();
63 css::uno::Reference< css::frame::XModuleManager2 > const & GetModuleManager();
65 bool m_bRemote;
66 bool m_bPreselectPassword;
67 bool m_bDialogUsed;
68 bool m_bSetStandardName;
69 sal_Int16 m_nStoreMode;
71 static bool FinishGUIStoreModel(::comphelper::SequenceAsHashMap::const_iterator& aFileNameIter,
72 ModelData_Impl& aModelData, bool bRemote, sal_Int16 nStoreMode,
73 css::uno::Sequence< css::beans::PropertyValue >& aFilterProps,
74 bool bSetStandardName, bool bPreselectPassword, bool bDialogUsed,
75 std::u16string_view aFilterFromMediaDescr, std::u16string_view aOldFilterName,
76 css::uno::Sequence< css::beans::PropertyValue >& aArgsSequence,
77 OUString aFilterName);
79 void CallFinishGUIStoreModel();
81 public:
82 SfxStoringHelper();
84 bool GUIStoreModel(
85 const css::uno::Reference< css::frame::XModel >& xModel,
86 std::u16string_view aSlotName,
87 css::uno::Sequence< css::beans::PropertyValue >& aArgsSequence,
88 bool bPreselectPassword,
89 SignatureState nDocumentSignatureState,
90 bool bIsAsync );
92 static bool CheckFilterOptionsAppearance(
93 const css::uno::Reference< css::container::XNameAccess >& xFilterCFG,
94 const OUString& aFilterName );
97 static void SetDocInfoState(
98 const css::uno::Reference< css::frame::XModel >& xModel,
99 const css::uno::Reference< css::document::XDocumentProperties>& i_xOldDocInfo );
101 static bool WarnUnacceptableFormat(
102 const css::uno::Reference< css::frame::XModel >& xModel,
103 std::u16string_view aOldUIName,
104 const OUString& aDefExtension,
105 bool rDefaultIsAlien );
107 static css::uno::Reference<css::awt::XWindow> GetModelXWindow(const css::uno::Reference<css::frame::XModel>& rModel);
108 static weld::Window* GetModelWindow( const css::uno::Reference< css::frame::XModel >& xModel );
112 #endif
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */