31#include <document.hxx>
38#include <unordered_map>
64namespace sfx2 {
class FileDialogHelper; }
77#define SC_PF_TESTMERGE 2
78#define SC_PF_WHOLEROWS 4
108 std::unique_ptr<ScDocShellModificator, o3tl::default_delete<ScDocShellModificator>>
m_pModificator;
114 css::uno::Reference<css::datatransfer::XTransferable2>
m_xClipData;
116 SAL_DLLPRIVATE
void InitItems();
117 SAL_DLLPRIVATE
void DoEnterHandler();
118 SAL_DLLPRIVATE
void InitOptions(
bool bForLoading);
119 SAL_DLLPRIVATE
void ResetDrawObjectShell();
132 SAL_DLLPRIVATE
bool LoadXML(
SfxMedium* pMedium,
const css::uno::Reference< css::embed::XStorage >& );
133 SAL_DLLPRIVATE
bool SaveXML(
SfxMedium* pMedium,
const css::uno::Reference< css::embed::XStorage >& );
134 SAL_DLLPRIVATE
SCTAB GetSaveTab();
138 SAL_DLLPRIVATE
ErrCode DBaseImport(
const OUString& rFullFileName, rtl_TextEncoding eCharSet,
140 SAL_DLLPRIVATE
ErrCode DBaseExport(
141 const OUString& rFullFileName, rtl_TextEncoding eCharSet,
bool& bHasMemo );
147 SAL_DLLPRIVATE
void LockPaint_Impl(
bool bDoc);
148 SAL_DLLPRIVATE
void UnlockPaint_Impl(
bool bDoc);
149 SAL_DLLPRIVATE
void LockDocument_Impl(sal_uInt16 nNew);
150 SAL_DLLPRIVATE
void UnlockDocument_Impl(sal_uInt16 nNew);
155 SAL_DLLPRIVATE
void UseSheetSaveEntries();
157 SAL_DLLPRIVATE std::unique_ptr<ScDocFunc> CreateDocFunc();
163 SFX_DECL_OBJECTFACTORY();
167 static
void InitInterface_Impl();
179 OUString * pFullTypeName,
180 sal_Int32 nFileFormat,
181 bool bTemplate =
false )
const override;
184 virtual std::shared_ptr<model::ColorSet>
GetThemeColors()
override;
186 virtual bool InitNew(
const css::uno::Reference< css::embed::XStorage >& )
override;
191 virtual bool Save()
override;
223 css::uno::Reference<css::datatransfer::XTransferable2>
const &
GetClipData()
const {
return m_xClipData; }
224 void SetClipData(
const css::uno::Reference<css::datatransfer::XTransferable2>& xTransferable) { m_xClipData = xTransferable; }
226 SfxPrinter* GetPrinter(
bool bCreateIfNotExist =
true );
229 void UpdateFontList();
240 void CompareDocument(
ScDocument& rOtherDoc );
242 bool MergeSharedDocument(
ScDocShell* pSharedDocShell );
245 void SetChangeComment(
ScChangeAction* pAction,
const OUString& rComment );
252 bool ExecuteChangeProtectionDialog(
bool bJustQueryIfProtected =
false );
254 void SetPrintZoom(
SCTAB nTab, sal_uInt16 nScale, sal_uInt16 nPages );
255 bool AdjustPrintZoom(
const ScRange& rRange );
257 void LoadStylesArgs(
ScDocShell& rSource,
bool bReplace,
bool bCellStyles,
bool bPageStyles );
259 void PageStyleModified( std::u16string_view rStyleName,
bool bApi );
262 void DoAutoStyle(
const ScRange& rRange,
const OUString& rStyle );
266 bool IsEditable()
const;
269 void UpdateAllRowHeights(
const ScMarkData* pTabMark =
nullptr );
270 void UpdateAllRowHeights(
const bool bOnlyUsedRows);
271 void UpdatePendingRowHeights(
SCTAB nUpdateTab,
bool bBefore =
false );
273 void RefreshPivotTables(
const ScRange& rSource );
275 void UseScenario(
SCTAB nTab,
const OUString& rName,
bool bRecord =
true );
276 SCTAB MakeScenario(
SCTAB nTab,
const OUString& rName,
const OUString& rComment,
279 void ModifyScenario(
SCTAB nTab,
const OUString& rName,
const OUString& rComment,
282 SCTAB nDestPos,
bool bInsertNew,
283 bool bNotifyAndPaint );
285 bool MoveTable(
SCTAB nSrcTab,
SCTAB nDestTab,
bool bCopy,
bool bRecord );
287 void DoRecalc(
bool bApi );
290 void UpdateOle(
const ScViewData& rViewData,
bool bSnapSize =
false);
296 std::unique_ptr<ScDBData> GetOldAutoDBRange();
297 void CancelAutoDBRange();
301 void SetInitialLinkUpdate(
const SfxMedium* pMedium );
302 void AllowLinkUpdate();
303 void ReloadAllLinks();
304 void ReloadTabLinks();
307 void SetFormulaOptions(
const ScFormulaOptions& rOpt,
bool bForLoading =
false );
312 void CheckConfigOptions();
318 sal_uInt16 nExtFlags = 0 );
322 void PostPaintCell(
const ScAddress& rPos );
323 void PostPaintGridAll();
324 void PostPaintExtras();
328 void PostDataChanged();
330 void UpdatePaintExt( sal_uInt16& rExtFlags,
SCCOL nStartCol,
SCROW nStartRow,
SCTAB nStartTab,
332 void UpdatePaintExt( sal_uInt16& rExtFlags,
const ScRange& rRange );
334 void SetDocumentModified();
335 void SetDrawModified();
340 void SetLockCount(sal_uInt16 nNew);
343 void UnlockDocument();
350 void SetInplace(
bool bInplace );
352 void SetEmpty(
bool bSet);
355 void SetInUndo(
bool bSet);
357 void CalcOutputFactor();
359 void GetPageOnFromPageStyleSet(
const SfxItemSet* pStyleSet,
365 virtual bool DdeGetData(
const OUString& rItem,
const OUString& rMimeType,
366 css::uno::Any & rValue )
override;
367 virtual bool DdeSetData(
const OUString& rItem,
const OUString& rMimeType,
368 const css::uno::Any & rValue )
override;
380 { m_bDocumentModifiedPending = bVal; }
382 {
return m_bDocumentModifiedPending; }
385 {
return m_bUpdateEnabled; }
387 { m_bUpdateEnabled = bValue; }
390 { m_bAreasChangedNeedBroadcast =
true; }
395 static SCTAB GetCurTab();
397 static ScDocShell* GetShellByNum( sal_uInt16 nDocNo );
398 static OUString GetOwnFilterName();
399 static OUString GetHtmlFilterName();
400 static OUString GetWebQueryFilterName();
401 static OUString GetAsciiFilterName();
402 static OUString GetLotusFilterName();
403 static OUString GetDBaseFilterName();
404 static OUString GetDifFilterName();
405 static bool HasAutomaticTableName( std::u16string_view rFilter );
410 void BeforeXMLLoading();
411 void AfterXMLLoading(
bool bRet);
424 virtual void SetChangeRecording(
bool bActivate,
bool bLockAllViews =
false )
override;
426 virtual bool GetProtectionHash( css::uno::Sequence< sal_Int8 > &rPasswordHash )
override;
430 void RegisterAutomationWorkbookObject(css::uno::Reference< ooo::vba::excel::XWorkbook >
const& xWorkbook);
475 if (rType ==
u"delete-content")
477 if (rType ==
u"delete-rows")
479 if (rType ==
u"delete-columns")
481 if (rType ==
u"undo")
483 if (rType ==
u"redo")
485 if (rType ==
u"paste")
487 if (rType ==
u"note")
499 const OUString &rType = OUString(
"cell-change"),
500 const css::uno::Sequence< css::beans::PropertyValue >& rProperties =
501 css::uno::Sequence< css::beans::PropertyValue >())
507 const OUString &rType = OUString(
"cell-change"))
513 Notify(*pModelObj, aChangeRanges, rType);
517 ? OUString(
"data-area-invalidate") : OUString(
"data-area-extend"));
Create before modifications of the document and destroy thereafter.
std::unique_ptr< ScRefreshTimerProtector > mpProtector
ScDocShellModificator(const ScDocShellModificator &)=delete
~ScDocShellModificator() COVERITY_NOEXCEPT_FALSE
ScDocShellModificator & operator=(const ScDocShellModificator &)=delete
bool bAutoCalcShellDisabled
void SetDocumentModified()
Do things that need to be done before saving to our own format and necessary clean ups in dtor.
css::uno::Reference< css::datatransfer::XTransferable2 > m_xClipData
bool IsUpdateEnabled() const
double m_nPrtToScreenFactor
DECL_DLLPRIVATE_LINK(DialogClosedHdl, sfx2::FileDialogHelper *, void)
void SetUpdateEnabled(bool bValue)
css::uno::Reference< ooo::vba::excel::XWorkbook > mxAutomationWorkbookObject
sal_uInt16 m_nDocumentLock
bool m_bDocumentModifiedPending
std::unique_ptr< ScDocFunc > m_pDocFunc
sal_uInt16 GetLockCount() const
void SetClipData(const css::uno::Reference< css::datatransfer::XTransferable2 > &xTransferable)
css::uno::Reference< css::datatransfer::XTransferable2 > const & GetClipData() const
SAL_DLLPRIVATE css::uno::Reference< css::frame::XModel > LoadSharedDocument()
std::unique_ptr< ScSheetSaveData > m_pSheetSaveData
std::unique_ptr< ScFormatSaveData > m_pFormatSaveData
bool m_bAreasChangedNeedBroadcast
const ScDocument & GetDocument() const
std::shared_ptr< ScDocument > m_pDocument
const OUString & GetDdeTextFmt() const
DECL_DLLPRIVATE_LINK(ReloadAllLinksHdl, weld::Button &, void)
std::unique_ptr< ScAutoStyleList > m_pAutoStyleList
std::unique_ptr< ScPaintLockData > m_pPaintLockData
std::unique_ptr< DocShell_Impl > m_pImpl
std::unique_ptr< ScDocShellModificator, o3tl::default_delete< ScDocShellModificator > > m_pModificator
bool IsDocumentModifiedPending() const
css::uno::Reference< css::script::vba::XVBAScriptListener > m_xVBAListener
std::unique_ptr< ScDBData > m_pOldAutoDBRange
void SetAreasChangedNeedBroadcast()
ScDocument & GetDocument()
void SetDocumentModifiedPending(bool bVal)
bool IsPaintLocked() const
SAL_DLLPRIVATE void EnableSharedSettings(bool bEnable)
ScModelObj * GetModel() const
double GetOutputFactor() const
DECL_DLLPRIVATE_LINK(RefreshDBDataHdl, Timer *, void)
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
bool HasChangesListeners() const
void NotifyChanges(const OUString &rOperation, const ScRangeList &rRanges, const css::uno::Sequence< css::beans::PropertyValue > &rProperties)
Additional class containing cell annotation data.
virtual bool HasChangeRecordProtection() const
virtual SfxStyleSheetBasePool * GetStyleSheetPool()
virtual bool InitNew(const css::uno::Reference< css::embed::XStorage > &xStorage)
virtual bool PrepareClose(bool bUI=true)
virtual bool ConvertFrom(SfxMedium &rMedium)
virtual void ReconnectDdeLink(SfxObjectShell &rServer)
virtual ::sfx2::SvLinkSource * DdeCreateLinkSource(const OUString &rItem)
virtual bool GetProtectionHash(css::uno::Sequence< sal_Int8 > &rPasswordHash)
virtual bool DoSaveCompleted(SfxMedium *pNewStor=nullptr, bool bRegisterRecent=true)
virtual bool LoadFrom(SfxMedium &rMedium)
virtual bool Load(SfxMedium &rMedium)
virtual std::shared_ptr< SfxDocumentInfoDialog > CreateDocumentInfoDialog(weld::Window *pParent, const SfxItemSet &rItemSet)
virtual bool SaveAs(SfxMedium &rMedium)
virtual void SetVisArea(const tools::Rectangle &rVisArea)
virtual std::shared_ptr< model::ColorSet > GetThemeColors()
virtual bool IsChangeRecording() const
virtual void Draw(OutputDevice *, const JobSetup &rSetup, sal_uInt16 nAspect, bool bOutputForScreen)=0
virtual bool ConvertTo(SfxMedium &rMedium)
virtual void SetProtectionPassword(const OUString &rPassword)
virtual bool QuerySlotExecutable(sal_uInt16 nSlotId)
css::uno::Reference< css::frame::XModel3 > GetModel() const
virtual std::set< Color > GetDocColors()
virtual void LoadStyles(SfxObjectShell &rSource)
virtual HiddenInformation GetHiddenInformationState(HiddenInformation nStates)
const tools::Rectangle & GetVisArea() const
virtual void SetChangeRecording(bool bActivate, bool bLockAllViews=false)
virtual Printer * GetDocumentPrinter()
virtual bool LoadExternal(SfxMedium &rMedium)
virtual void FillClass(SvGlobalName *pClassName, SotClipboardFormatId *pFormat, OUString *pFullTypeName, sal_Int32 nVersion, bool bTemplate=false) const=0
virtual void UpdateLinks()
virtual void TerminateEditing()
virtual void SetModified(bool bModified=true)
virtual SfxUndoManager * GetUndoManager()
LOKCommentNotificationType
SAL_DLLPUBLIC_EXPORT bool TestImportDBF(SvStream &rStream)
tools::SvRef< ScDocShell > ScDocShellRef
void UpdateAcceptChangesDialog()
std::unordered_map< sal_uLong, sal_uLong > ScChangeActionMergeMap
void VBA_InsertModule(ScDocument &rDoc, SCTAB nTab, const OUString &sModuleSource)
constexpr OUStringLiteral IsDocument(u"IsDocument")
bool KillFile(const INetURLObject &rURL)
ScGetDBSelection
For ScDBFunc::GetDBData()
bool isDataAreaInvalidateType(std::u16string_view rType)
void NotifyIfChangesListeners(const ScDocShell &rDocShell, const ScRange &rRange, const OUString &rType=OUString("cell-change"))
void Notify(ScModelObj &rModelObj, const ScRangeList &rChangeRanges, const OUString &rType=OUString("cell-change"), const css::uno::Sequence< css::beans::PropertyValue > &rProperties=css::uno::Sequence< css::beans::PropertyValue >())
bool getMustPropagateChangesModel(ScModelObj *pModelObj)
void LOKCommentNotify(CommentNotificationType nType, const SfxViewShell *pViewShell, css::uno::Reference< css::office::XAnnotation > const &rxAnnotation)
#define SFX_DECL_INTERFACE(nId)
void SetPrinter(IDocumentDeviceAccess *, SfxPrinter const *, bool bWeb)