diff options
-rw-r--r-- | cui/source/dialogs/SpellDialog.cxx | 2 | ||||
-rw-r--r-- | cui/source/options/fontsubs.cxx | 3 | ||||
-rw-r--r-- | cui/source/options/webconninfo.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/anyrefdg.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/namedlg/namemgrtable.cxx | 3 | ||||
-rw-r--r-- | sw/source/ui/dialog/wordcountdialog.cxx | 2 | ||||
-rw-r--r-- | vcl/inc/vcl/dialog.hxx | 4 | ||||
-rw-r--r-- | vcl/inc/vcl/layout.hxx | 4 | ||||
-rw-r--r-- | vcl/source/window/dialog.cxx | 9 | ||||
-rw-r--r-- | vcl/source/window/layout.cxx | 8 | ||||
-rw-r--r-- | xmlsecurity/source/dialogs/macrosecurity.cxx | 10 |
11 files changed, 39 insertions, 14 deletions
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index 412a0b828121..f098a287a217 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -371,7 +371,7 @@ void SpellDialog::UpdateBoxes_Impl() } if (bOldShowExplain != (bool) m_pExplainLink->IsVisible() || bOldShowGrammar != (bool) m_pCheckGrammarCB->IsVisible()) - setInitialLayoutSize(); + setOptimalLayoutSize(); } // ----------------------------------------------------------------------- diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx index 2f94e8b95aef..0702c99cfe43 100644 --- a/cui/source/options/fontsubs.cxx +++ b/cui/source/options/fontsubs.cxx @@ -410,7 +410,8 @@ void SvxFontSubstCheckListBox::setColSizes() void SvxFontSubstCheckListBox::Resize() { SvxSimpleTable::Resize(); - setColSizes(); + if (isInitialLayout(this)) + setColSizes(); } void SvxFontSubstCheckListBox::SetTabs() diff --git a/cui/source/options/webconninfo.cxx b/cui/source/options/webconninfo.cxx index eb59b4ec3b87..d56ebb8d94b8 100644 --- a/cui/source/options/webconninfo.cxx +++ b/cui/source/options/webconninfo.cxx @@ -28,6 +28,7 @@ #include <comphelper/processfactory.hxx> #include <comphelper/docpasswordrequest.hxx> #include "svtools/treelistentry.hxx" +#include <vcl/layout.hxx> using namespace ::com::sun::star; @@ -78,7 +79,8 @@ void PasswordTable::Resort( bool bForced ) void PasswordTable::Resize() { SvxSimpleTable::Resize(); - setColWidths(); + if (isInitialLayout(this)) + setColWidths(); } void PasswordTable::setColWidths() diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx index d5b0fed784c2..6af81de0f0da 100644 --- a/sc/source/ui/miscdlgs/anyrefdg.cxx +++ b/sc/source/ui/miscdlgs/anyrefdg.cxx @@ -401,7 +401,7 @@ void ScFormulaReferenceHelper::RefInputDone( bool bForced ) Dialog* pResizeDialog = pRefEdit->GetParentDialog(); pResizeDialog->set_border_width(m_nOldBorderWidth); pResizeDialog->get_action_area()->Show(); - pResizeDialog->setInitialLayoutSize(); + pResizeDialog->setOptimalLayoutSize(); } pRefEdit = NULL; @@ -573,7 +573,7 @@ void ScFormulaReferenceHelper::RefInputStart( formula::RefEdit* pEdit, formula:: m_nOldBorderWidth = pResizeDialog->get_border_width(); pResizeDialog->set_border_width(0); pResizeDialog->get_action_area()->Hide(); - pResizeDialog->setInitialLayoutSize(); + pResizeDialog->setOptimalLayoutSize(); } } } diff --git a/sc/source/ui/namedlg/namemgrtable.cxx b/sc/source/ui/namedlg/namemgrtable.cxx index 7c9ee05e7025..163cd8417997 100644 --- a/sc/source/ui/namedlg/namemgrtable.cxx +++ b/sc/source/ui/namedlg/namemgrtable.cxx @@ -94,7 +94,8 @@ ScRangeManagerTable::ScRangeManagerTable( SvxSimpleTableContainer& rParent, boos void ScRangeManagerTable::Resize() { SvxSimpleTable::Resize(); - setColWidths(); + if (isInitialLayout(this)) + setColWidths(); } void ScRangeManagerTable::setColWidths() diff --git a/sw/source/ui/dialog/wordcountdialog.cxx b/sw/source/ui/dialog/wordcountdialog.cxx index 6d8d738b25bf..66b64fa669b5 100644 --- a/sw/source/ui/dialog/wordcountdialog.cxx +++ b/sw/source/ui/dialog/wordcountdialog.cxx @@ -71,7 +71,7 @@ void SwWordCountFloatDlg::SetValues(const SwDocStat& rCurrent, const SwDocStat& if (bToggleCJK) { showCJK(bShowCJK); - setInitialLayoutSize(); //force resize of dialog + setOptimalLayoutSize(); //force resize of dialog } } diff --git a/vcl/inc/vcl/dialog.hxx b/vcl/inc/vcl/dialog.hxx index 7fc2a4d75ae7..1f14ae144948 100644 --- a/vcl/inc/vcl/dialog.hxx +++ b/vcl/inc/vcl/dialog.hxx @@ -52,6 +52,7 @@ private: sal_Bool mbInClose; sal_Bool mbModalMode; bool mbIsDefferedInit; + bool mbIsCalculatingInitialLayoutSize; Timer maLayoutTimer; SAL_DLLPRIVATE void ImplInitDialogData(); @@ -94,7 +95,8 @@ public: virtual Size GetOptimalSize() const; virtual void Resize(); bool isLayoutEnabled() const; - void setInitialLayoutSize(); + void setOptimalLayoutSize(); + bool isCalculatingInitialLayoutSize() const { return mbIsCalculatingInitialLayoutSize; } virtual void queue_layout(); virtual bool set_property(const rtl::OString &rKey, const rtl::OString &rValue); VclButtonBox* get_action_area(); diff --git a/vcl/inc/vcl/layout.hxx b/vcl/inc/vcl/layout.hxx index 63277252d672..cd06ae6476f7 100644 --- a/vcl/inc/vcl/layout.hxx +++ b/vcl/inc/vcl/layout.hxx @@ -670,6 +670,10 @@ VCL_DLLPUBLIC inline bool isContainerWindow(const Window *pWindow) return pWindow && isContainerWindow(*pWindow); } +//Returns true if the containing dialog is doing its initial +//layout and isn't visible yet +VCL_DLLPUBLIC bool isInitialLayout(const Window *pWindow); + // retro-fitting utilities // //Get a Size which is large enough to contain all children with diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 467de4b4f04b..a756b27e99fa 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -354,6 +354,7 @@ void Dialog::ImplInitDialogData() mbOldSaveBack = sal_False; mbInClose = sal_False; mbModalMode = sal_False; + mbIsCalculatingInitialLayoutSize = false; mnMousePositioned = 0; mpDialogImpl = new DialogImpl; @@ -655,7 +656,7 @@ Size bestmaxFrameSizeForScreenSize(const Size &rScreenSize) return Size(w, h); } -void Dialog::setInitialLayoutSize() +void Dialog::setOptimalLayoutSize() { maLayoutTimer.Stop(); @@ -696,7 +697,11 @@ void Dialog::StateChanged( StateChangedType nType ) if ( nType == STATE_CHANGE_INITSHOW ) { if (isLayoutEnabled()) - setInitialLayoutSize(); + { + mbIsCalculatingInitialLayoutSize = true; + setOptimalLayoutSize(); + mbIsCalculatingInitialLayoutSize = false; + } if ( GetSettings().GetStyleSettings().GetAutoMnemonic() ) ImplWindowAutoMnemonic( this ); diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index c488e206c97c..4d986407d7a0 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -1368,7 +1368,7 @@ IMPL_LINK( VclExpander, ClickHdl, DisclosureButton*, pBtn ) queue_resize(); Dialog* pResizeDialog = m_bResizeTopLevel ? GetParentDialog() : NULL; if (pResizeDialog) - pResizeDialog->setInitialLayoutSize(); + pResizeDialog->setOptimalLayoutSize(); } return 0; } @@ -1645,4 +1645,10 @@ bool isLayoutEnabled(const Window *pWindow) return pChild && isContainerWindow(*pChild) && !pChild->GetWindow(WINDOW_NEXT); } +bool isInitialLayout(const Window *pWindow) +{ + Dialog *pParentDialog = pWindow ? pWindow->GetParentDialog() : NULL; + return pParentDialog && pParentDialog->isCalculatingInitialLayoutSize(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/dialogs/macrosecurity.cxx b/xmlsecurity/source/dialogs/macrosecurity.cxx index fe77313acbd7..3a0a745fe203 100644 --- a/xmlsecurity/source/dialogs/macrosecurity.cxx +++ b/xmlsecurity/source/dialogs/macrosecurity.cxx @@ -25,6 +25,7 @@ #include <osl/file.hxx> #include <vcl/help.hxx> +#include <vcl/layout.hxx> #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> @@ -334,9 +335,12 @@ public: virtual void Resize() { SvxSimpleTable::Resize(); - const long nControlWidth = GetSizePixel().Width(); - long aTabLocs[] = { 3, 0, 35*nControlWidth/100, 70*nControlWidth/100 }; - SvxSimpleTable::SetTabs(aTabLocs, MAP_PIXEL); + if (isInitialLayout(this)) + { + const long nControlWidth = GetSizePixel().Width(); + long aTabLocs[] = { 3, 0, 35*nControlWidth/100, 70*nControlWidth/100 }; + SvxSimpleTable::SetTabs(aTabLocs, MAP_PIXEL); + } } }; |