LibreOffice Module sw (master) 1
DocumentStateManager.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 */
20#include <doc.hxx>
22#include <IDocumentUndoRedo.hxx>
24#include <acorrect.hxx>
25
26namespace sw
27{
28
30 m_rDoc( i_rSwdoc ),
31 mbEnableSetModified(true),
32 mbModified(false),
33 mbUpdateExpField(false),
34 mbNewDoc(false),
35 mbInCallModified(false)
36{
37}
38
40{
42 return;
43
45 mbModified = true;
47 if( m_rDoc.GetOle2Link().IsSet() )
48 {
49 mbInCallModified = true;
50 m_rDoc.GetOle2Link().Call( true );
51 mbInCallModified = false;
52 }
53
56}
57
59{
60 // give the old and new modified state to the link
61 // Bit 0: -> old state
62 // Bit 1: -> new state
63 bool bOldModified = mbModified;
64 mbModified = false;
66 m_rDoc.GetIDocumentUndoRedo().SetUndoNoModifiedPosition();
67 if( bOldModified && m_rDoc.GetOle2Link().IsSet() )
68 {
69 mbInCallModified = true;
70 m_rDoc.GetOle2Link().Call( false );
71 mbInCallModified = false;
72 }
73}
74
76{
77 return mbModified;
78}
79
81{
83}
84
85void DocumentStateManager::SetEnableSetModified(bool bEnableSetModified)
86{
87 mbEnableSetModified = bEnableSetModified;
88}
89
91{
92 return mbInCallModified;
93}
94
96{
97 return mbUpdateExpField;
98}
99
101{
102 return mbNewDoc;
103}
104
106{
107 mbNewDoc = b;
108}
109
111{
113}
114
115}
116
117
118/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool IsDeleted() const
Definition: acorrect.hxx:114
Definition: doc.hxx:197
SwAutoCorrExceptWord * GetAutoCorrExceptWord()
Definition: doc.hxx:1410
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:158
const Link< bool, void > & GetOle2Link() const
Definition: doc.hxx:1347
void DeleteAutoCorrExceptWord()
Definition: docedt.cxx:821
::sw::DocumentLayoutManager const & GetDocumentLayoutManager() const
Definition: doc.cxx:429
::sw::DocumentStatisticsManager const & GetDocumentStatisticsManager() const
Definition: doc.cxx:397
void SetEnableSetModified(bool bEnableSetModified) override
bool IsInCallModified() const override
DocumentStateManager(SwDoc &i_rSwdoc)
void SetUpdateExpFieldStat(bool b) override
bool IsUpdateExpField() const override
bool IsEnableSetModified() const override
bool IsModified() const override
Changes of document?
bool IsNewDoc() const override
void SetNewDoc(bool b) override
void SetModified() override
Must be called manually at changes of format.
SwDoc & m_rDoc
Definition: docbm.cxx:1228
Dialog to specify the properties of date form field.
bool mbModified