diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-10-05 15:00:39 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-10-05 15:19:05 +0200 |
commit | 9db74c6133ede2a28af077fd563398176ff0d858 (patch) | |
tree | 06161435d835a269c1ed17e590ba73b3653075c6 /sfx2 | |
parent | aed09ee69fb2e5edfb02c4df81ef1adee407c54f (diff) |
fdo#46071: Do not hide windows based on nil "Visible" property
This appears to be messy: The /org.openoffice.Office.Views/WindowType
configuration group template has both a nilable bool "Visible" property and a
UserData/Data string property that encodes various things like geometry---but
also visibility---in a string.
Now, likely due to the problem that has meanwhile been fixed through
f3f79cc9e6c265baf48955d53f7e888205e0b3e0 "Resolves fdo#46074: Fix
Partial::contains for paths that go past a leaf node," some
registrymodification.xcu files in the wild contain such WindowType entries in
"default" state, without a UserData/Data string and with a nil "Visible"
property.
The way SfxChildWindow::InitializeChildWinFactory_Impl and
SvtViewOptions::IsVisible are implemented, they will always lead to an invisible
window for such broken registrymodification.xcu data (as IsVisible unhelpfully
returns false for a nil value, and InitializeChildWinFactory_Impl uses that
value when there is no UserData/Data string).
For the Math formula editor window (ID 30378) this means that it can disappear
from the UI completely, as there appears to be no UI trigger for the user to
show it in case it is hidden.
The fix is to introdue SvtViewOptions::HasVisible (which only returns true if
the property is not nil) and change InitializeChidlWinFactory_Impl to only use
the value of IsVisible() if HasVisible() returns true. This makes the code even
more baroque, but this is a rather central, generic piece of code for all sorts
of windows, so I do not want to break any other uses by e.g. changing IsVisible
to return true for a nil property.
Change-Id: Iae40075a7116a8aabd2d25aa9334709522e23d8f
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/childwin.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index 18038dac690c..e1e24be242c0 100644 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -352,7 +352,7 @@ void SfxChildWindow::InitializeChildWinFactory_Impl( sal_uInt16 nId, SfxChildWin // load configuration SvtViewOptions aWinOpt( E_WINDOW, String::CreateFromInt32( nId ) ); - if ( aWinOpt.Exists() ) + if ( aWinOpt.Exists() && aWinOpt.HasVisible() ) rInfo.bVisible = aWinOpt.IsVisible(); // set state from configuration. Can be overwritten by UserData, see below ::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq = aWinOpt.GetUserData(); |