LibreOffice Module sc (master) 1
forbiuno.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
22#include <vcl/svapp.hxx>
23
24#include <forbiuno.hxx>
25#include <docsh.hxx>
26
27using namespace ::com::sun::star;
28
29static std::shared_ptr<SvxForbiddenCharactersTable> lcl_GetForbidden( ScDocShell* pDocSh )
30{
31 std::shared_ptr<SvxForbiddenCharactersTable> xRet;
32 if ( pDocSh )
33 {
34 ScDocument& rDoc = pDocSh->GetDocument();
35 xRet = rDoc.GetForbiddenCharacters();
36 if (!xRet)
37 {
38 // create an empty SvxForbiddenCharactersTable for SvxUnoForbiddenCharsTable,
39 // so changes can be stored.
41 rDoc.SetForbiddenCharacters( xRet );
42 }
43 }
44 return xRet;
45}
46
49 pDocShell( pDocSh )
50{
51 if (pDocShell)
53}
54
56{
58
59 if (pDocShell)
61}
62
64{
65 if ( rHint.GetId() == SfxHintId::Dying )
66 {
67 pDocShell = nullptr; // document gone
68 }
69}
70
72{
73 if (pDocShell)
74 {
78 }
79}
80
81/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void PostPaintGridAll()
Definition: docsh3.cxx:183
void SetDocumentModified()
Definition: docsh.cxx:2982
const ScDocument & GetDocument() const
Definition: docsh.hxx:219
void AddUnoObject(SfxListener &rObject)
Definition: documen3.cxx:901
const std::shared_ptr< SvxForbiddenCharactersTable > & GetForbiddenCharacters() const
Definition: documen9.cxx:604
void RemoveUnoObject(SfxListener &rObject)
Definition: documen3.cxx:909
void SetForbiddenCharacters(const std::shared_ptr< SvxForbiddenCharactersTable > &rNew)
Definition: documen9.cxx:609
virtual ~ScForbiddenCharsObj() override
Definition: forbiuno.cxx:55
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: forbiuno.cxx:63
ScForbiddenCharsObj(ScDocShell *pDocSh)
Definition: forbiuno.cxx:47
ScDocShell * pDocShell
Definition: forbiuno.hxx:31
virtual void onChange() override
Definition: forbiuno.cxx:71
SfxHintId GetId() const
static std::shared_ptr< SvxForbiddenCharactersTable > makeForbiddenCharactersTable(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
std::shared_ptr< SvxForbiddenCharactersTable > mxForbiddenChars
static std::shared_ptr< SvxForbiddenCharactersTable > lcl_GetForbidden(ScDocShell *pDocSh)
Definition: forbiuno.cxx:29
Reference< XComponentContext > getProcessComponentContext()