tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sc / source / ui / inc / docsh.hxx
blob046cf75ea3a378a81389d04927927efc0ca42bdb
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 #include <sfx2/objsh.hxx>
23 #include <sfx2/docfac.hxx>
24 #include <sfx2/sfxmodelfactory.hxx>
25 #include <sfx2/viewsh.hxx>
26 #include <o3tl/deleter.hxx>
27 #include <comphelper/lok.hxx>
28 #include <comphelper/servicehelper.hxx>
30 #include <scdllapi.h>
31 #include <document.hxx>
32 #include <shellids.hxx>
33 #include <optutil.hxx>
34 #include <docuno.hxx>
36 #include <memory>
37 #include <string_view>
38 #include <unordered_map>
39 #include <map>
41 class ScRefreshTimerProtector;
42 class ScEditEngineDefaulter;
43 class SfxStyleSheetBasePool;
44 class SfxStyleSheetHint;
45 class INetURLObject;
47 class ScViewData;
48 class ScDocFunc;
49 class ScDrawLayer;
50 class ScTabViewShell;
51 class ScAutoStyleList;
52 class ScMarkData;
53 class ScPaintLockData;
54 class ScChangeAction;
55 class ScImportOptions;
56 class ScDocShellModificator;
57 class ScSheetSaveData;
58 class ScFlatBoolRowSegments;
59 struct ScColWidthParam;
60 class ScFormulaOptions;
61 namespace com::sun::star::script::vba { class XVBAScriptListener; }
62 namespace ooo::vba::excel { class XWorkbook; }
63 namespace com::sun::star::datatransfer { class XTransferable2; }
64 namespace sfx2 { class FileDialogHelper; }
65 struct DocShell_Impl;
67 typedef std::unordered_map< sal_uLong, sal_uLong > ScChangeActionMergeMap;
69 //enum ScDBFormat { SC_FORMAT_SDF, SC_FORMAT_DBF };
71 enum class LOKCommentNotificationType { Add, Modify, Remove };
73 extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportDBF(SvStream &rStream);
75 // Extra flags for Repaint
76 #define SC_PF_LINES 1
77 #define SC_PF_TESTMERGE 2
78 #define SC_PF_WHOLEROWS 4
80 class SAL_DLLPUBLIC_RTTI ScDocShell final: public SfxObjectShell, public SfxListener
82 std::shared_ptr<ScDocument> m_pDocument;
84 OUString m_aDdeTextFmt;
86 double m_nPrtToScreenFactor;
87 std::unique_ptr<DocShell_Impl> m_pImpl;
88 std::unique_ptr<ScDocFunc> m_pDocFunc;
90 bool m_bHeaderOn;
91 bool m_bFooterOn;
92 bool m_bIsInplace:1; // Is set by the View
93 bool m_bIsEmpty:1;
94 bool m_bIsInUndo:1;
95 bool m_bDocumentModifiedPending:1;
96 bool m_bUpdateEnabled:1;
97 bool m_bAreasChangedNeedBroadcast:1;
98 sal_uInt16 m_nDocumentLock;
99 sal_Int16 m_nCanUpdate; // stores the UpdateDocMode from loading a document till update links
101 std::unique_ptr<ScDBData> m_pOldAutoDBRange;
103 std::unique_ptr<ScAutoStyleList> m_pAutoStyleList;
104 std::unique_ptr<ScPaintLockData> m_pPaintLockData;
105 std::unique_ptr<ScSheetSaveData> m_pSheetSaveData;
106 std::unique_ptr<ScFormatSaveData> m_pFormatSaveData;
108 std::unique_ptr<ScDocShellModificator, o3tl::default_delete<ScDocShellModificator>> m_pModificator; // #109979#; is used to load XML (created in BeforeXMLLoading and destroyed in AfterXMLLoading)
110 css::uno::Reference< ooo::vba::excel::XWorkbook> mxAutomationWorkbookObject;
112 // Only used by Vba helper functions
113 css::uno::Reference<css::script::vba::XVBAScriptListener> m_xVBAListener;
114 css::uno::Reference<css::datatransfer::XTransferable2> m_xClipData;
116 void InitItems();
117 void DoEnterHandler();
118 void InitOptions(bool bForLoading);
119 void ResetDrawObjectShell();
121 /** Do things that need to be done before saving to our own format and
122 necessary clean ups in dtor. */
123 class PrepareSaveGuard
125 public:
126 explicit PrepareSaveGuard( ScDocShell & rDocShell );
127 ~PrepareSaveGuard() COVERITY_NOEXCEPT_FALSE;
128 private:
129 ScDocShell & mrDocShell;
132 bool LoadXML( SfxMedium* pMedium, const css::uno::Reference< css::embed::XStorage >& );
133 bool SaveXML( SfxMedium* pMedium, const css::uno::Reference< css::embed::XStorage >& );
134 SCTAB GetSaveTab();
136 friend bool TestImportDBF(SvStream &rStream);
138 ErrCode DBaseImport( const OUString& rFullFileName, rtl_TextEncoding eCharSet,
139 std::map<SCCOL, ScColWidthParam>& aColWidthParam, ScFlatBoolRowSegments& rRowHeightsRecalc );
140 ErrCodeMsg DBaseExport(
141 const OUString& rFullFileName, rtl_TextEncoding eCharSet, bool& bHasMemo );
143 static bool MoveFile( const INetURLObject& rSource, const INetURLObject& rDest );
144 static bool KillFile( const INetURLObject& rURL );
145 static bool IsDocument( const INetURLObject& rURL );
147 void LockPaint_Impl(bool bDoc);
148 void UnlockPaint_Impl(bool bDoc);
149 void LockDocument_Impl(sal_uInt16 nNew);
150 void UnlockDocument_Impl(sal_uInt16 nNew);
152 void EnableSharedSettings( bool bEnable );
153 css::uno::Reference< css::frame::XModel > LoadSharedDocument();
155 void UseSheetSaveEntries();
157 std::unique_ptr<ScDocFunc> CreateDocFunc();
159 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
161 public:
162 SFX_DECL_INTERFACE(SCID_DOC_SHELL)
163 SC_DLLPUBLIC static SfxObjectFactory& Factory(); \
164 virtual SfxObjectFactory& GetFactory() const override { return Factory(); }
166 private:
167 /// SfxInterface initializer.
168 static void InitInterface_Impl();
170 public:
171 explicit ScDocShell( const ScDocShell& rDocShell ) = delete;
172 SC_DLLPUBLIC explicit ScDocShell( const SfxModelFlags i_nSfxCreationFlags = SfxModelFlags::EMBEDDED_OBJECT, const std::shared_ptr<ScDocument>& pDoc = {} );
173 virtual ~ScDocShell() override;
175 SC_DLLPUBLIC virtual SfxUndoManager* GetUndoManager() override;
177 virtual void FillClass( SvGlobalName * pClassName,
178 SotClipboardFormatId * pFormat,
179 OUString * pFullTypeName,
180 sal_Int32 nFileFormat,
181 bool bTemplate = false ) const override;
183 std::shared_ptr<sfx::IDocumentModelAccessor> GetDocumentModelAccessor() const override;
184 virtual std::set<Color> GetDocColors() override;
185 virtual std::shared_ptr<model::ColorSet> GetThemeColors() override;
187 virtual bool InitNew( const css::uno::Reference< css::embed::XStorage >& ) override;
188 virtual bool Load( SfxMedium& rMedium ) override;
189 virtual bool LoadFrom( SfxMedium& rMedium ) override;
190 virtual bool ConvertFrom( SfxMedium &rMedium ) override;
191 virtual bool LoadExternal( SfxMedium& rMedium ) override;
192 virtual bool Save() override;
193 virtual bool SaveAs( SfxMedium& rMedium ) override;
194 virtual bool ConvertTo( SfxMedium &rMedium ) override;
195 virtual bool PrepareClose( bool bUI = true ) override;
196 virtual void LoadStyles( SfxObjectShell &rSource ) override;
198 virtual bool DoSaveCompleted( SfxMedium * pNewStor=nullptr, bool bRegisterRecent=true ) override; // SfxObjectShell
199 virtual bool QuerySlotExecutable( sal_uInt16 nSlotId ) override;
201 virtual void Draw(OutputDevice *, const JobSetup & rSetup, sal_uInt16 nAspect, bool bOutputForScreen) override;
203 SC_DLLPUBLIC virtual void SetVisArea( const tools::Rectangle & rVisArea ) override;
205 virtual void TerminateEditing() override;
207 using SfxObjectShell::GetVisArea;
208 virtual tools::Rectangle GetVisArea( sal_uInt16 nAspect ) const override;
210 virtual Printer* GetDocumentPrinter() override;
212 virtual void SetModified( bool = true ) override;
214 void SetVisAreaOrSize( const tools::Rectangle& rVisArea );
216 virtual std::shared_ptr<SfxDocumentInfoDialog> CreateDocumentInfoDialog(weld::Window* pParent, const SfxItemSet &rSet) override;
218 SC_DLLPUBLIC void GetDocStat( ScDocStat& rDocStat );
220 const ScDocument& GetDocument() const { return *m_pDocument; }
221 ScDocument& GetDocument() { return *m_pDocument; }
222 ScDocFunc& GetDocFunc() { return *m_pDocFunc; }
224 css::uno::Reference<css::datatransfer::XTransferable2> const & GetClipData() const { return m_xClipData; }
225 void SetClipData(const css::uno::Reference<css::datatransfer::XTransferable2>& xTransferable) { m_xClipData = xTransferable; }
227 SfxPrinter* GetPrinter( bool bCreateIfNotExist = true );
228 sal_uInt16 SetPrinter( VclPtr<SfxPrinter> const & pNewPrinter, SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL );
230 void UpdateFontList();
232 ScDrawLayer* MakeDrawLayer();
234 void AsciiSave( SvStream& rStream, const ScImportOptions& rOpt, SCTAB nTab );
236 void Execute( SfxRequest& rReq );
237 void GetState( SfxItemSet &rSet );
238 void ExecutePageStyle ( const SfxViewShell& rCaller, SfxRequest& rReq, SCTAB nCurTab );
239 void GetStatePageStyle( SfxItemSet& rSet, SCTAB nCurTab );
241 void CompareDocument( ScDocument& rOtherDoc );
242 void MergeDocument( ScDocument& rOtherDoc, bool bShared = false, bool bCheckDuplicates = false, sal_uLong nOffset = 0, ScChangeActionMergeMap* pMergeMap = nullptr, bool bInverseMap = false );
243 bool MergeSharedDocument( ScDocShell* pSharedDocShell );
245 ScChangeAction* GetChangeAction( const ScAddress& rPos );
246 void SetChangeComment( ScChangeAction* pAction, const OUString& rComment );
247 void ExecuteChangeCommentDialog( ScChangeAction* pAction, weld::Window* pParent, bool bPrevNext = true );
248 /// Protect/unprotect ChangeTrack and return <TRUE/> if
249 /// protection was successfully changed.
250 /// If bJustQueryIfProtected==sal_True protection is not
251 /// changed and <TRUE/> is returned if not protected or
252 /// password was entered correctly.
253 bool ExecuteChangeProtectionDialog( bool bJustQueryIfProtected = false );
255 void SetPrintZoom( SCTAB nTab, sal_uInt16 nScale, sal_uInt16 nPages );
256 bool AdjustPrintZoom( const ScRange& rRange );
258 void LoadStylesArgs( ScDocShell& rSource, bool bReplace, bool bCellStyles, bool bPageStyles );
260 void PageStyleModified( std::u16string_view rStyleName, bool bApi );
262 void NotifyStyle( const SfxStyleSheetHint& rHint );
263 void DoAutoStyle( const ScRange& rRange, const OUString& rStyle );
265 SC_DLLPUBLIC static weld::Window* GetActiveDialogParent();
266 void ErrorMessage(TranslateId pGlobStrId);
267 bool IsEditable() const;
269 /// check config if on file-open optimal row heights should run, or if the user should be asked
270 SC_DLLPUBLIC bool GetRecalcRowHeightsMode();
271 bool AdjustRowHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab );
272 SC_DLLPUBLIC void UpdateAllRowHeights( const ScMarkData* pTabMark = nullptr );
273 SC_DLLPUBLIC void UpdateAllRowHeights(const bool bOnlyUsedRows);
274 void UpdatePendingRowHeights( SCTAB nUpdateTab, bool bBefore = false );
276 void RefreshPivotTables( const ScRange& rSource );
277 void DoConsolidate( const ScConsolidateParam& rParam, bool bRecord = true );
278 void UseScenario( SCTAB nTab, const OUString& rName, bool bRecord = true );
279 SCTAB MakeScenario(SCTAB nTab, const OUString& rName, const OUString& rComment,
280 const Color& rColor, ScScenarioFlags nFlags,
281 ScMarkData& rMark, bool bRecord = true);
282 void ModifyScenario(SCTAB nTab, const OUString& rName, const OUString& rComment,
283 const Color& rColor, ScScenarioFlags nFlags);
284 SC_DLLPUBLIC bool TransferTab( ScDocShell& rSrcDocShell, SCTAB nSrcPos,
285 SCTAB nDestPos, bool bInsertNew,
286 bool bNotifyAndPaint );
288 bool MoveTable( SCTAB nSrcTab, SCTAB nDestTab, bool bCopy, bool bRecord );
290 SC_DLLPUBLIC void DoRecalc( bool bApi );
291 SC_DLLPUBLIC void DoHardRecalc();
293 void UpdateOle(const ScViewData& rViewData, bool bSnapSize = false);
294 bool IsOle() const;
296 void DBAreaDeleted( SCTAB nTab, SCCOL nX1, SCROW nY1, SCCOL nX2 );
297 ScDBData* GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGetDBSelection eSel );
298 ScDBData* GetAnonymousDBData(const ScRange& rRange);
299 std::unique_ptr<ScDBData> GetOldAutoDBRange();
300 void CancelAutoDBRange(); // called when dialog is cancelled
302 virtual void ReconnectDdeLink(SfxObjectShell& rServer) override;
303 void UpdateLinks() override;
304 SC_DLLPUBLIC void SetInitialLinkUpdate( const SfxMedium* pMedium );
305 void AllowLinkUpdate();
306 SC_DLLPUBLIC void ReloadAllLinks();
307 void ReloadTabLinks();
308 ScLkUpdMode GetLinkUpdateModeState() const;
310 SC_DLLPUBLIC void SetFormulaOptions( const ScFormulaOptions& rOpt, bool bForLoading = false );
312 * Called when the Options dialog is dismissed with the OK button, to
313 * handle potentially conflicting option settings.
315 void CheckConfigOptions();
317 void PostEditView( ScEditEngineDefaulter* pEditEngine, const ScAddress& rCursorPos );
319 tools::Long GetTwipWidthHint(const ScAddress& rPos);
321 void PostPaint( SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab,
322 SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, PaintPartFlags nPart,
323 sal_uInt16 nExtFlags = 0, tools::Long nMaxWidthAffectedHint = -1 );
324 SC_DLLPUBLIC void PostPaint( const ScRangeList& rRanges, PaintPartFlags nPart, sal_uInt16 nExtFlags = 0,
325 tools::Long nMaxWidthAffectedHint = -1 );
327 void PostPaintCell( SCCOL nCol, SCROW nRow, SCTAB nTab, tools::Long nMaxWidthAffectedHint = -1);
328 void PostPaintCell( const ScAddress& rPos, tools::Long nMaxWidthAffectedHint = -1);
329 SC_DLLPUBLIC void PostPaintGridAll();
330 void PostPaintExtras();
332 bool IsPaintLocked() const { return m_pPaintLockData != nullptr; }
334 void PostDataChanged();
336 void UpdatePaintExt( sal_uInt16& rExtFlags, SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab,
337 SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab );
338 void UpdatePaintExt( sal_uInt16& rExtFlags, const ScRange& rRange );
340 SC_DLLPUBLIC void SetDocumentModified();
341 void SetDrawModified();
343 SC_DLLPUBLIC void LockPaint();
344 SC_DLLPUBLIC void UnlockPaint();
345 sal_uInt16 GetLockCount() const { return m_nDocumentLock;}
346 void SetLockCount(sal_uInt16 nNew);
348 void LockDocument();
349 void UnlockDocument();
351 DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper*, void );
352 DECL_LINK( ReloadAllLinksHdl, weld::Button&, void );
354 virtual SfxStyleSheetBasePool* GetStyleSheetPool() override;
356 void SetInplace( bool bInplace );
357 bool IsEmpty() const { return m_bIsEmpty; }
358 SC_DLLPUBLIC void SetEmpty(bool bSet);
360 bool IsInUndo() const { return m_bIsInUndo; }
361 void SetInUndo(bool bSet);
363 void CalcOutputFactor();
364 double GetOutputFactor() const { return m_nPrtToScreenFactor;}
365 void GetPageOnFromPageStyleSet( const SfxItemSet* pStyleSet,
366 SCTAB nCurTab,
367 bool& rbHeader,
368 bool& rbFooter );
370 #if defined(_WIN32)
371 virtual bool DdeGetData( const OUString& rItem, const OUString& rMimeType,
372 css::uno::Any & rValue ) override;
373 virtual bool DdeSetData( const OUString& rItem, const OUString& rMimeType,
374 const css::uno::Any & rValue ) override;
375 #endif
377 virtual ::sfx2::SvLinkSource* DdeCreateLinkSource( const OUString& rItem ) override;
379 const OUString& GetDdeTextFmt() const { return m_aDdeTextFmt; }
381 SAL_RET_MAYBENULL SfxBindings* GetViewBindings();
383 SAL_RET_MAYBENULL SC_DLLPUBLIC ScTabViewShell* GetBestViewShell( bool bOnlyVisible = true );
385 void SetDocumentModifiedPending( bool bVal )
386 { m_bDocumentModifiedPending = bVal; }
387 bool IsDocumentModifiedPending() const
388 { return m_bDocumentModifiedPending; }
390 bool IsUpdateEnabled() const
391 { return m_bUpdateEnabled; }
392 void SetUpdateEnabled(bool bValue)
393 { m_bUpdateEnabled = bValue; }
395 void SetAreasChangedNeedBroadcast()
396 { m_bAreasChangedNeedBroadcast = true; }
398 OutputDevice* GetRefDevice(); // WYSIWYG: Printer, otherwise VirtualDevice...
400 SAL_RET_MAYBENULL SC_DLLPUBLIC static ScViewData* GetViewData();
401 SC_DLLPUBLIC static SCTAB GetCurTab();
403 SAL_RET_MAYBENULL static ScDocShell* GetShellByNum( sal_uInt16 nDocNo );
404 static OUString GetOwnFilterName();
405 static const OUString & GetHtmlFilterName();
406 static const OUString & GetWebQueryFilterName();
407 static const OUString & GetAsciiFilterName();
408 static const OUString & GetLotusFilterName();
409 static const OUString & GetDBaseFilterName();
410 static const OUString & GetDifFilterName();
411 static bool HasAutomaticTableName( std::u16string_view rFilter );
412 static void LOKCommentNotify(LOKCommentNotificationType nType, const ScDocument& rDocument, const ScAddress& rPos, const ScPostIt* pNote);
414 DECL_LINK( RefreshDBDataHdl, Timer*, void );
416 void BeforeXMLLoading();
417 void AfterXMLLoading(bool bRet);
419 virtual HiddenInformation GetHiddenInformationState( HiddenInformation nStates ) override;
421 ScSheetSaveData* GetSheetSaveData();
422 ScFormatSaveData* GetFormatSaveData();
424 static void ResetKeyBindings( ScOptionsUtil::KeyBindingType eType );
426 // password protection for Calc (derived from SfxObjectShell)
427 // see also: FID_CHG_RECORD, SID_CHG_PROTECT
428 virtual bool IsChangeRecording() const override;
429 virtual bool HasChangeRecordProtection() const override;
430 virtual void SetChangeRecording( bool bActivate, bool bLockAllViews = false ) override;
431 virtual void SetProtectionPassword( const OUString &rPassword ) override;
432 virtual bool GetProtectionHash( /*out*/ css::uno::Sequence< sal_Int8 > &rPasswordHash ) override;
434 void SnapVisArea( tools::Rectangle& rRect ) const;
436 SC_DLLPUBLIC void RegisterAutomationWorkbookObject(css::uno::Reference< ooo::vba::excel::XWorkbook > const& xWorkbook);
438 ScModelObj* GetModel() const { return static_cast<ScModelObj*>(SfxObjectShell::GetModel().get()); }
440 private:
441 void ExecuteChartSource(SfxRequest& rReq);
442 void ExecuteChartSourcePost( bool bUndo, bool bMultiRange,
443 const OUString& rChartName, const ScRangeListRef& rRangeListRef,
444 bool bColHeaders, bool bRowHeaders, bool bAddRange,
445 SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCTAB nTab);
448 void UpdateAcceptChangesDialog();
450 typedef rtl::Reference<ScDocShell> ScDocShellRef;
452 /** Create before modifications of the document and destroy thereafter.
453 Call SetDocumentModified() at an instance of this class instead of at
454 ScDocShell.
456 Remembers in the ctor ScDocument's AutoCalcShellDisabled and IdleDisabled,
457 switches them off and restores them in the dtor, AutoCalcShellDisabled
458 also before a ScDocShell::SetDocumentModified() call if necessary.
459 In the dtor, if ScDocShell's bDocumentModifiedPending is set and
460 bAutoCalcShellDisabled is not set, then ScDocShell::SetDocumentModified()
461 is called.
463 Several instances can be used in nested calls to ScDocFunc or ScDocShell
464 methods to avoid multiple modified status changes, only the last instance
465 destroyed calls ScDocShell::SetDocumentModified().
467 class ScDocShellModificator
469 ScDocShell& rDocShell;
470 std::unique_ptr<ScRefreshTimerProtector> mpProtector;
471 bool bAutoCalcShellDisabled;
472 bool bIdleEnabled;
474 ScDocShellModificator( const ScDocShellModificator& ) = delete;
475 ScDocShellModificator& operator=( const ScDocShellModificator& ) = delete;
477 void ImplDestroy();
479 public:
480 explicit ScDocShellModificator( ScDocShell& );
481 ~ScDocShellModificator();
482 void SetDocumentModified();
485 //#i97876# Spreadsheet data changes are not notified
486 namespace HelperNotifyChanges
488 inline bool isDataAreaInvalidateType(std::u16string_view rType)
490 if (rType == u"delete-content")
491 return true;
492 if (rType == u"delete-rows")
493 return true;
494 if (rType == u"delete-columns")
495 return true;
496 if (rType == u"undo")
497 return true;
498 if (rType == u"redo")
499 return true;
500 if (rType == u"paste")
501 return true;
502 if (rType == u"note")
503 return true;
505 return false;
508 inline bool getMustPropagateChangesModel(ScModelObj* pModelObj)
510 return pModelObj && pModelObj->HasChangesListeners();
513 inline void Notify(ScModelObj &rModelObj, const ScRangeList &rChangeRanges,
514 const OUString &rType = u"cell-change"_ustr,
515 const css::uno::Sequence< css::beans::PropertyValue >& rProperties =
516 css::uno::Sequence< css::beans::PropertyValue >())
518 rModelObj.NotifyChanges(rType, rChangeRanges, rProperties);
521 inline void NotifyIfChangesListeners(const ScDocShell &rDocShell, const ScRange &rRange,
522 const OUString &rType = u"cell-change"_ustr)
524 ScModelObj* pModelObj = rDocShell.GetModel();
525 ScRangeList aChangeRanges(rRange);
527 if (getMustPropagateChangesModel(pModelObj))
528 Notify(*pModelObj, aChangeRanges, rType);
529 else if (pModelObj) // possibly need to invalidate getCellArea results
531 Notify(*pModelObj, aChangeRanges, isDataAreaInvalidateType(rType)
532 ? u"data-area-invalidate"_ustr : u"data-area-extend"_ustr);
537 void VBA_InsertModule( ScDocument& rDoc, SCTAB nTab, const OUString& sModuleSource );
539 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */