diff options
Diffstat (limited to 'sfx2/source/notebookbar/SfxNotebookBar.cxx')
-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 ); |