Kaydet (Commit) 7aa79223 authored tarafından Jan Holesovsky's avatar Jan Holesovsky

bnc#467278: Introduce a warning that changes to VBA macros cannot be saved.

As an InfoBar, so hopefully not annoying...

Change-Id: I5d4e79273edc03829fdab2d6d5a291576c954e4b
üst d967e03a
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
#define RID_STR_OPEN ( RID_BASICIDE_START + 20 ) #define RID_STR_OPEN ( RID_BASICIDE_START + 20 )
#define RID_STR_SAVE ( RID_BASICIDE_START + 21 ) #define RID_STR_SAVE ( RID_BASICIDE_START + 21 )
#define RID_STR_RUNTIMEERROR ( RID_BASICIDE_START + 22 ) #define RID_STR_RUNTIMEERROR ( RID_BASICIDE_START + 22 )
#define RID_STR_CANNOTSAVEVBA ( RID_BASICIDE_START + 23 )
#define RID_STR_STDDIALOGNAME ( RID_BASICIDE_START + 24 ) #define RID_STR_STDDIALOGNAME ( RID_BASICIDE_START + 24 )
#define RID_STR_STDMODULENAME ( RID_BASICIDE_START + 27 ) #define RID_STR_STDMODULENAME ( RID_BASICIDE_START + 27 )
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <sfx2/app.hxx> #include <sfx2/app.hxx>
#include <sfx2/dinfdlg.hxx> #include <sfx2/dinfdlg.hxx>
#include <sfx2/dispatch.hxx> #include <sfx2/dispatch.hxx>
#include <sfx2/infobar.hxx>
#include <sfx2/minfitem.hxx> #include <sfx2/minfitem.hxx>
#include <sfx2/objface.hxx> #include <sfx2/objface.hxx>
#include <svl/aeitem.hxx> #include <svl/aeitem.hxx>
...@@ -140,8 +141,8 @@ SFX_IMPL_INTERFACE(basctl_Shell, SfxViewShell, IDEResId(RID_STR_IDENAME)) ...@@ -140,8 +141,8 @@ SFX_IMPL_INTERFACE(basctl_Shell, SfxViewShell, IDEResId(RID_STR_IDENAME))
void basctl_Shell::InitInterface_Impl() void basctl_Shell::InitInterface_Impl()
{ {
GetStaticInterface()->RegisterChildWindow(SID_SEARCH_DLG); GetStaticInterface()->RegisterChildWindow(SID_SEARCH_DLG);
GetStaticInterface()->RegisterChildWindow(SID_SHOW_PROPERTYBROWSER, false, BASICIDE_UI_FEATURE_SHOW_BROWSER); GetStaticInterface()->RegisterChildWindow(SID_SHOW_PROPERTYBROWSER, false, BASICIDE_UI_FEATURE_SHOW_BROWSER);
GetStaticInterface()->RegisterChildWindow(SfxInfoBarContainerChild::GetChildWindowId());
GetStaticInterface()->RegisterPopupMenu(IDEResId(RID_POPUP_DLGED)); GetStaticInterface()->RegisterPopupMenu(IDEResId(RID_POPUP_DLGED));
} }
...@@ -253,7 +254,14 @@ Shell::~Shell() ...@@ -253,7 +254,14 @@ Shell::~Shell()
void Shell::onDocumentCreated( const ScriptDocument& /*_rDocument*/ ) void Shell::onDocumentCreated( const ScriptDocument& /*_rDocument*/ )
{ {
if (pCurWin) if (pCurWin)
{
pCurWin->OnNewDocument(); pCurWin->OnNewDocument();
// for VBA documents, show a warning that we can save them only in ODF
if (pCurWin->GetDocument().isInVBAMode())
GetViewFrame()->AppendInfoBar("vba_save", IDE_RESSTR(RID_STR_CANNOTSAVEVBA));
}
UpdateWindows(); UpdateWindows();
} }
......
...@@ -216,6 +216,10 @@ String RID_STR_CANNOTCLOSE ...@@ -216,6 +216,10 @@ String RID_STR_CANNOTCLOSE
{ {
Text [ en-US ] = "The window cannot be closed while BASIC is running." ; Text [ en-US ] = "The window cannot be closed while BASIC is running." ;
}; };
String RID_STR_CANNOTSAVEVBA
{
Text [ en-US ] = "You are editing a VBA macro. Changes can be saved only in OpenDocument Format." ;
};
String RID_STR_REPLACESTDLIB String RID_STR_REPLACESTDLIB
{ {
Text [ en-US ] = "The default library cannot be replaced." ; Text [ en-US ] = "The default library cannot be replaced." ;
......
...@@ -194,7 +194,7 @@ public: ...@@ -194,7 +194,7 @@ public:
The buttons will be added from Right to Left at the right of the info bar. The parent, size The buttons will be added from Right to Left at the right of the info bar. The parent, size
and position of each button will be changed: only the width will remain unchanged. and position of each button will be changed: only the width will remain unchanged.
*/ */
void AppendInfoBar( const OUString& sId, const OUString& sMessage, std::vector< PushButton* > aButtons ); void AppendInfoBar( const OUString& sId, const OUString& sMessage, std::vector< PushButton* > aButtons = std::vector< PushButton* >() );
void RemoveInfoBar( const OUString& sId ); void RemoveInfoBar( const OUString& sId );
SAL_DLLPRIVATE void SetDowning_Impl(); SAL_DLLPRIVATE void SetDowning_Impl();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment