diff options
author | Szymon Kłos <eszkadev@gmail.com> | 2016-09-12 16:29:24 +0200 |
---|---|---|
committer | Szymon Kłos <eszkadev@gmail.com> | 2016-09-13 06:56:50 +0000 |
commit | 7aa6e5ce82eaca64f666b9fc6c0351bfd55d376a (patch) | |
tree | 754013665c8d024516611bbd5e96f9552a6830f4 /sfx2 | |
parent | e137caed30052359783f2b112eee72553be1bd4f (diff) |
tdf#102065 Notebookbar: Menu bar disappears when cancelling dialog
Change-Id: I6f83248eddfc279fe69f0f9c1d64d6b453bb1d3e
Reviewed-on: https://gerrit.libreoffice.org/28843
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Szymon Kłos <eszkadev@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/notebookbar/SfxNotebookBar.cxx | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx index e12beadc2886..e103d69073b3 100644 --- a/sfx2/source/notebookbar/SfxNotebookBar.cxx +++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx @@ -199,7 +199,23 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow, RemoveListeners(pSysWindow); OUString sFile = officecfg::Office::UI::Notebookbar::Active::get(); - if ( !sFile.isEmpty() ) + OUString sNewFile = rUIFile + sFile; + OUString sCurrentFile; + if ( pSysWindow->GetNotebookBar() ) + sCurrentFile = OStringToOUString( pSysWindow->GetNotebookBar()->getUIFile(), RTL_TEXTENCODING_ASCII_US ); + + bool bChangedFile = true; + if ( sCurrentFile.getLength() && sNewFile.getLength() ) + { + // delete "/" + sCurrentFile = sCurrentFile.copy( 0, sCurrentFile.getLength() - 1 ); + // delete ".ui" + sNewFile = sNewFile.copy( 0, sNewFile.getLength() - 3 ); + + bChangedFile = ( sNewFile.compareTo( sCurrentFile ) != 0 ); + } + + if ( !sFile.isEmpty() && bChangedFile ) { OUStringBuffer aBuf(rUIFile); aBuf.append( sFile ); |