summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/sfx2/tabdlg.hxx2
-rw-r--r--sfx2/source/dialog/tabdlg.cxx7
-rw-r--r--sw/source/ui/fldui/flddb.cxx4
-rw-r--r--sw/source/ui/fldui/flddb.hxx1
4 files changed, 13 insertions, 1 deletions
diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
index 6397868a21d0..daa092b8d9b7 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -213,6 +213,8 @@ public:
virtual bool FillItemSet( SfxItemSet* );
virtual void Reset( const SfxItemSet* );
+ // Allows to postpone some initialization to the first activation
+ virtual bool DeferResetToFirstActivation();
bool HasExchangeSupport() const
{ return bHasExchangeSupport; }
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 6f71e91fea88..47fa332390db 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -169,6 +169,8 @@ void SfxTabPage::Reset( const SfxItemSet* )
{
}
+bool SfxTabPage::DeferResetToFirstActivation() { return false; }
+
void SfxTabPage::ActivatePage( const SfxItemSet& )
/* [Description]
@@ -920,7 +922,10 @@ void SfxTabDialogController::CreatePages()
pDataObject->xTabPage->SetUserData(sUserData);
PageCreated(pDataObject->sId, *pDataObject->xTabPage);
- pDataObject->xTabPage->Reset(m_pSet.get());
+ if (pDataObject->xTabPage->DeferResetToFirstActivation())
+ pDataObject->bRefresh = true; // Reset will be called in ActivatePageHdl
+ else
+ pDataObject->xTabPage->Reset(m_pSet.get());
}
}
diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx
index 963e1834533e..14492377629b 100644
--- a/sw/source/ui/fldui/flddb.cxx
+++ b/sw/source/ui/fldui/flddb.cxx
@@ -178,6 +178,10 @@ void SwFieldDBPage::Reset(const SfxItemSet*)
}
}
+// SwFieldDBPage may ask for password to select current document's data source,
+// so only do that when activating the page, not when dialog is creating all pages
+bool SwFieldDBPage::DeferResetToFirstActivation() { return true; }
+
bool SwFieldDBPage::FillItemSet(SfxItemSet* )
{
OUString sTableName;
diff --git a/sw/source/ui/fldui/flddb.hxx b/sw/source/ui/fldui/flddb.hxx
index e507fcb86ee0..b25c38699234 100644
--- a/sw/source/ui/fldui/flddb.hxx
+++ b/sw/source/ui/fldui/flddb.hxx
@@ -70,6 +70,7 @@ public:
virtual bool FillItemSet( SfxItemSet* rSet ) override;
virtual void Reset( const SfxItemSet* rSet ) override;
+ virtual bool DeferResetToFirstActivation() override;
virtual void FillUserData() override;
void ActivateMailMergeAddress();