summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorThomas Lange [tl] <tl@openoffice.org>2010-05-19 14:28:33 +0200
committerThomas Lange [tl] <tl@openoffice.org>2010-05-19 14:28:33 +0200
commit4659d84eb4e0e8038ac21044ddd3c390e2585581 (patch)
treeefe3ba22cd20b6b5ffc8bc5f11c112ef1357ab42 /sfx2
parent65cf934efc6f8958d9c024ee965685cfd6cac704 (diff)
cws tl79: #i110254# new security tap page in 'File/Properties'
Diffstat (limited to 'sfx2')
-rwxr-xr-x[-rw-r--r--]sfx2/inc/sfx2/objsh.hxx7
-rwxr-xr-xsfx2/inc/sfx2/sfx.hrc2
-rwxr-xr-x[-rw-r--r--]sfx2/sdi/sfx.sdi2
-rwxr-xr-xsfx2/source/dialog/securitypage.cxx320
-rwxr-xr-xsfx2/source/dialog/securitypage.hrc6
-rwxr-xr-xsfx2/source/dialog/securitypage.src19
-rwxr-xr-x[-rw-r--r--]sfx2/source/doc/objxtor.cxx24
7 files changed, 261 insertions, 119 deletions
diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx
index 5fc5a641fd44..7984fae956cb 100644..100755
--- a/sfx2/inc/sfx2/objsh.hxx
+++ b/sfx2/inc/sfx2/objsh.hxx
@@ -683,6 +683,13 @@ public:
sal_Int32 nVersion,
sal_Bool bTemplate = sal_False) const = 0;
+ // change recording and respective passwword protection for Writer and Calc
+ // slots available for Writer: FN_REDLINE_ON, FN_REDLINE_ON
+ // slots used for Calc: FID_CHG_RECORD, SID_CHG_PROTECT
+ virtual void SetChangeRecording( bool bActivate );
+ virtual bool SetProtectionPassword( const String &rPassword );
+ virtual bool GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal_Int8 > &rPasswordHash );
+
// =================================
//#if 0 // _SOLAR__PRIVATE
diff --git a/sfx2/inc/sfx2/sfx.hrc b/sfx2/inc/sfx2/sfx.hrc
index 137218e3c117..3ed7f34ee3b8 100755
--- a/sfx2/inc/sfx2/sfx.hrc
+++ b/sfx2/inc/sfx2/sfx.hrc
@@ -234,6 +234,8 @@
#define TP_MANAGE_STYLES (RID_SFX_START+7)
#define DLG_STYLE_DESIGNER (RID_SFX_START+8)
+#define RID_SFX_INCORRECT_PASSWORD (RID_SFX_START+216)
+
#define STR_STYLE_FILTER_AUTO (RID_SFX_START+9)
#define STR_STYLE_FILTER_USED (RID_SFX_START+10)
#define STR_STYLE_FILTER_USERDEF (RID_SFX_START+11)
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index 10a920852848..e4ff0dc8d2b5 100644..100755
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -31,7 +31,7 @@ SfxBoolItem _SwitchViewShell0 SID_VIEWSHELL0
[
/* flags: */
AutoUpdate = FALSE,
- Cachable = Cachable,
+ Cachable = Cachable, 
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
diff --git a/sfx2/source/dialog/securitypage.cxx b/sfx2/source/dialog/securitypage.cxx
index d6351143c51e..d4f217671d6e 100755
--- a/sfx2/source/dialog/securitypage.cxx
+++ b/sfx2/source/dialog/securitypage.cxx
@@ -38,64 +38,70 @@
#include <sfx2/objsh.hxx>
#include <sfx2/viewsh.hxx>
#include <sfx2/dispatch.hxx>
+#include <sfx2/passwd.hxx>
#include <vcl/button.hxx>
#include <vcl/edit.hxx>
#include <vcl/fixed.hxx>
+#include <vcl/msgbox.hxx>
#include <svl/eitem.hxx>
#include <svl/poolitem.hxx>
#include <svl/intitem.hxx>
+#include <svl/PasswordHelper.hxx>
#include <svtools/xwindowitem.hxx>
+using namespace ::com::sun::star;
//////////////////////////////////////////////////////////////////////
-namespace
+static short lcl_GetPassword( Window *pParent, bool bShowConfirm, /*out*/String &rPassword )
{
- enum RedliningMode { RL_NONE, RL_WRITER, RL_CALC };
+ bool bRes = false;
+ SfxPasswordDialog aPasswdDlg( pParent );
+ if (bShowConfirm)
+ aPasswdDlg.ShowExtras( SHOWEXTRAS_CONFIRM );
+ if (RET_OK == aPasswdDlg.Execute() && aPasswdDlg.GetPassword().Len() > 0)
+ {
+ rPassword = aPasswdDlg.GetPassword();
+ bRes = true;
+ }
+ return bRes;
+}
- enum RedlineFunc { RF_ON, RF_PROTECT };
- const SfxBoolItem* ExecuteRecordChangesFunc( RedliningMode _eMode, RedlineFunc _eFunc, BOOL _bVal, Window* _pParent = NULL )
- {
- const SfxBoolItem* pRet = NULL;
+static bool lcl_IsPasswordCorrect( const String &rPassword )
+{
+ bool bRes = false;
- if (_eMode != RL_NONE)
- {
- USHORT nSlot;
- if (_eMode == RL_WRITER)
- nSlot = _eFunc == RF_ON ? FN_REDLINE_ON : FN_REDLINE_PROTECT;
- else
- nSlot = _eFunc == RF_ON ? FID_CHG_RECORD : SID_CHG_PROTECT;
+ SfxObjectShell* pCurDocShell = SfxObjectShell::Current();
+ uno::Sequence< sal_Int8 > aPasswordHash;
+ bool bHasPassword = pCurDocShell->GetProtectionHash( aPasswordHash );
+
+ // check if supplied password was correct
+ uno::Sequence< sal_Int8 > aNewPasswd( aPasswordHash );
+ SvPasswordHelper::GetHashPassword( aNewPasswd, rPassword );
+ if (SvPasswordHelper::CompareHashPassword( aPasswordHash, rPassword ))
+ bRes = true; // password was correct
+ else
+ InfoBox( NULL, String( SfxResId( RID_SFX_INCORRECT_PASSWORD ) ) ).Execute();
- // execute
- SfxViewShell* pViewSh = SfxViewShell::Current();
- if (pViewSh)
- {
- bool bNeedItem = _eMode == RL_WRITER || _eFunc != RF_ON;
- SfxBoolItem* pItem = bNeedItem ? new SfxBoolItem( nSlot, _bVal ) : NULL;
- SfxDispatcher* pDisp = pViewSh->GetDispatcher();
- if (_pParent)
- {
- XWindowItem aParentItem( SID_ATTR_XWINDOW, _pParent );
- pRet = static_cast< const SfxBoolItem* >(
- pDisp->Execute( nSlot, SFX_CALLMODE_SYNCHRON, &aParentItem, pItem, 0L ) );
- }
- else
- pRet = static_cast< const SfxBoolItem* >(
- pDisp->Execute( nSlot, SFX_CALLMODE_SYNCHRON, pItem, 0L ) );
- delete pItem;
- }
- }
+ return bRes;
+}
+
+
+//////////////////////////////////////////////////////////////////////
+
+
+namespace
+{
+ enum RedliningMode { RL_NONE, RL_WRITER, RL_CALC };
+ enum RedlineFunc { RF_ON, RF_PROTECT };
- return pRet;
- }
bool QueryState( USHORT _nSlot, bool& _rValue )
{
bool bRet = false;
-
SfxViewShell* pViewSh = SfxViewShell::Current();
if (pViewSh)
{
@@ -105,33 +111,30 @@ namespace
if (bRet)
_rValue = ( static_cast< const SfxBoolItem* >( pItem ) )->GetValue();
}
-
return bRet;
}
+
bool QueryRecordChangesProtectionState( RedliningMode _eMode, bool& _rValue )
{
bool bRet = false;
-
if (_eMode != RL_NONE)
{
USHORT nSlot = _eMode == RL_WRITER ? FN_REDLINE_PROTECT : SID_CHG_PROTECT;
bRet = QueryState( nSlot, _rValue );
}
-
return bRet;
}
+
bool QueryRecordChangesState( RedliningMode _eMode, bool& _rValue )
{
bool bRet = false;
-
if (_eMode != RL_NONE)
{
USHORT nSlot = _eMode == RL_WRITER ? FN_REDLINE_ON : FID_CHG_RECORD;
bRet = QueryState( nSlot, _rValue );
}
-
return bRet;
}
}
@@ -142,64 +145,71 @@ namespace
struct SfxSecurityPage_Impl
{
- SfxSecurityPage & m_rDialog;
+ SfxSecurityPage & m_rMyTabPage;
- FixedLine m_aPasswordToOpenFL;
- FixedText m_aPasswordToOpenFT;
- Edit m_aPasswordToOpenED;
+ FixedLine m_aNewPasswordToOpenFL;
+ FixedText m_aNewPasswordToOpenFT;
+ Edit m_aNewPasswordToOpenED;
FixedText m_aConfirmPasswordToOpenFT;
Edit m_aConfirmPasswordToOpenED;
- FixedText m_aPasswordInfoFT;
+ FixedText m_aNewPasswordInfoFT;
- FixedLine m_aPasswordToModifyFL;
- FixedText m_aPasswordToModifyFT;
- Edit m_aPasswordToModifyED;
+ FixedLine m_aNewPasswordToModifyFL;
+ FixedText m_aNewPasswordToModifyFT;
+ Edit m_aNewPasswordToModifyED;
FixedText m_aConfirmPasswordToModifyFT;
Edit m_aConfirmPasswordToModifyED;
FixedLine m_aOptionsFL;
CheckBox m_aOpenReadonlyCB;
- CheckBox m_aRemoveInfoOnSavingCB;
CheckBox m_aRecordChangesCB; // for record changes
PushButton m_aChangeProtectionPB; // for record changes
String m_aProtectSTR; // for record changes
String m_aUnProtectSTR; // for record changes
RedliningMode m_eRedlingMode; // for record changes
+ bool m_bOrigPasswordIsConfirmed;
+ bool m_bNewPasswordIsValid;
+ String m_aNewPassword;
+
+ String m_aEndRedliningWarning;
+ bool m_bEndRedliningWarningDone;
+
DECL_LINK( RecordChangesCBHdl, void* );
DECL_LINK( ChangeProtectionPBHdl, void* );
SfxSecurityPage_Impl( SfxSecurityPage &rDlg, const SfxItemSet &rItemSet );
~SfxSecurityPage_Impl();
- void CheckRecordChangesState( void );
-
BOOL FillItemSet_Impl( SfxItemSet & );
void Reset_Impl( const SfxItemSet & );
};
-SfxSecurityPage_Impl::SfxSecurityPage_Impl( SfxSecurityPage &rDlg, const SfxItemSet & ) :
- m_rDialog (rDlg),
- m_aPasswordToOpenFL (&rDlg, SfxResId( PASSWORD_TO_OPEN_FL ) ),
- m_aPasswordToOpenFT (&rDlg, SfxResId( PASSWORD_TO_OPEN_FT ) ),
- m_aPasswordToOpenED (&rDlg, SfxResId( PASSWORD_TO_OPEN_ED ) ),
- m_aConfirmPasswordToOpenFT (&rDlg, SfxResId( CONFIRM_PASSWORD_TO_OPEN_FT ) ),
- m_aConfirmPasswordToOpenED (&rDlg, SfxResId( CONFIRM_PASSWORD_TO_OPEN_ED ) ),
- m_aPasswordInfoFT (&rDlg, SfxResId( PASSWORD_INFO_FT ) ),
- m_aPasswordToModifyFL (&rDlg, SfxResId( PASSWORD_TO_MODIFY_FL ) ),
- m_aPasswordToModifyFT (&rDlg, SfxResId( PASSWORD_TO_MODIFY_FT ) ),
- m_aPasswordToModifyED (&rDlg, SfxResId( PASSWORD_TO_MODIFY_ED ) ),
- m_aConfirmPasswordToModifyFT (&rDlg, SfxResId( CONFIRM_PASSWORD_TO_MODIFY_FT ) ),
- m_aConfirmPasswordToModifyED (&rDlg, SfxResId( CONFIRM_PASSWORD_TO_MODIFY_ED ) ),
- m_aOptionsFL (&rDlg, SfxResId( OPTIONS_FL ) ),
- m_aOpenReadonlyCB (&rDlg, SfxResId( OPEN_READONLY_CB ) ),
- m_aRemoveInfoOnSavingCB (&rDlg, SfxResId( REMOVE_INFO_ON_SAVING_CB ) ),
- m_aRecordChangesCB (&rDlg, SfxResId( RECORD_CHANGES_CB ) ),
- m_aChangeProtectionPB (&rDlg, SfxResId( CHANGE_PROTECTION_PB ) ),
+SfxSecurityPage_Impl::SfxSecurityPage_Impl( SfxSecurityPage &rTabPage, const SfxItemSet & ) :
+ m_rMyTabPage (rTabPage),
+ m_aNewPasswordToOpenFL (&rTabPage, SfxResId( PASSWORD_TO_OPEN_FL ) ),
+ m_aNewPasswordToOpenFT (&rTabPage, SfxResId( PASSWORD_TO_OPEN_FT ) ),
+ m_aNewPasswordToOpenED (&rTabPage, SfxResId( PASSWORD_TO_OPEN_ED ) ),
+ m_aConfirmPasswordToOpenFT (&rTabPage, SfxResId( CONFIRM_PASSWORD_TO_OPEN_FT ) ),
+ m_aConfirmPasswordToOpenED (&rTabPage, SfxResId( CONFIRM_PASSWORD_TO_OPEN_ED ) ),
+ m_aNewPasswordInfoFT (&rTabPage, SfxResId( PASSWORD_INFO_FT ) ),
+ m_aNewPasswordToModifyFL (&rTabPage, SfxResId( PASSWORD_TO_MODIFY_FL ) ),
+ m_aNewPasswordToModifyFT (&rTabPage, SfxResId( PASSWORD_TO_MODIFY_FT ) ),
+ m_aNewPasswordToModifyED (&rTabPage, SfxResId( PASSWORD_TO_MODIFY_ED ) ),
+ m_aConfirmPasswordToModifyFT (&rTabPage, SfxResId( CONFIRM_PASSWORD_TO_MODIFY_FT ) ),
+ m_aConfirmPasswordToModifyED (&rTabPage, SfxResId( CONFIRM_PASSWORD_TO_MODIFY_ED ) ),
+ m_aOptionsFL (&rTabPage, SfxResId( OPTIONS_FL ) ),
+ m_aOpenReadonlyCB (&rTabPage, SfxResId( OPEN_READONLY_CB ) ),
+ m_aRecordChangesCB (&rTabPage, SfxResId( RECORD_CHANGES_CB ) ),
+ m_aChangeProtectionPB (&rTabPage, SfxResId( CHANGE_PROTECTION_PB ) ),
m_aProtectSTR ( SfxResId( STR_PROTECT ) ),
m_aUnProtectSTR ( SfxResId( STR_UNPROTECT ) ),
- m_eRedlingMode ( RL_NONE )
+ m_eRedlingMode ( RL_NONE ),
+ m_bOrigPasswordIsConfirmed ( false ),
+ m_bNewPasswordIsValid ( false ),
+ m_aEndRedliningWarning ( SfxResId( STR_END_REDLINING_WARNING ) ),
+ m_bEndRedliningWarningDone ( false )
{
m_aChangeProtectionPB.SetText( m_aProtectSTR );
// adjust button width if necessary
@@ -218,30 +228,46 @@ SfxSecurityPage_Impl::~SfxSecurityPage_Impl()
}
-void SfxSecurityPage_Impl::CheckRecordChangesState( void )
-{
- bool bVal;
- if (QueryRecordChangesState( m_eRedlingMode, bVal ))
- {
- m_aRecordChangesCB.Enable();
- m_aRecordChangesCB.Check( bVal );
- }
- else
- m_aRecordChangesCB.Disable(); // because now we don't know the state!
-
- m_aChangeProtectionPB.Enable( QueryRecordChangesProtectionState( m_eRedlingMode, bVal ) );
-}
-
-
BOOL SfxSecurityPage_Impl::FillItemSet_Impl( SfxItemSet & )
{
- BOOL bModified = FALSE;
+ bool bModified = false;
SfxObjectShell* pCurDocShell = SfxObjectShell::Current();
if (pCurDocShell)
{
+ if (m_eRedlingMode != RL_NONE && !pCurDocShell->IsReadOnly())
+ {
+ // change recording
+ const bool bDoRecordChanges = m_aRecordChangesCB.IsChecked();
+ pCurDocShell->SetChangeRecording( bDoRecordChanges );
+
+ // no change recording should imply no password protection
+ if (!bDoRecordChanges && (!m_bNewPasswordIsValid || m_aNewPassword.Len() != 0))
+ {
+ // actually this should not be possible. Thus just as 'coded comment':
+ DBG_ASSERT( 0, "unexpected state of UI" );
+ m_bNewPasswordIsValid = true;
+ m_aNewPassword = String();
+ }
+
+ // change record protection
+ if (m_bNewPasswordIsValid)
+ {
+ const bool bDoChangeProtection = m_aChangeProtectionPB.GetText() != m_aProtectSTR;
+ DBG_ASSERT( !bDoChangeProtection || bDoRecordChanges,
+ "change protection requires record changes to be active!" );
+ pCurDocShell->SetProtectionPassword( m_aNewPassword );
+ }
+
+ bModified = true;
+ }
+
+ // open read-only?
if (pCurDocShell->HasSecurityOptOpenReadOnly())
+ {
pCurDocShell->SetSecurityOptOpenReadOnly( m_aOpenReadonlyCB.IsChecked() );
+ bModified = true;
+ }
}
return bModified;
@@ -284,23 +310,37 @@ void SfxSecurityPage_Impl::Reset_Impl( const SfxItemSet & )
else
m_aOpenReadonlyCB.Disable();
- bool bVal;
- if (QueryRecordChangesState( RL_WRITER, bVal ) && !bIsHTMLDoc)
+ bool bRecordChanges;
+ if (QueryRecordChangesState( RL_WRITER, bRecordChanges ) && !bIsHTMLDoc)
m_eRedlingMode = RL_WRITER;
- else if (QueryRecordChangesState( RL_CALC, bVal ))
+ else if (QueryRecordChangesState( RL_CALC, bRecordChanges ))
m_eRedlingMode = RL_CALC;
else
m_eRedlingMode = RL_NONE;
if (m_eRedlingMode != RL_NONE)
{
- m_aRecordChangesCB.Check( bVal );
- m_aRecordChangesCB.Enable( !bVal && !bIsReadonly );
- m_aChangeProtectionPB.Enable(
- QueryRecordChangesProtectionState( m_eRedlingMode, bVal ) && !bIsReadonly );
+ bool bProtection;
+ QueryRecordChangesProtectionState( m_eRedlingMode, bProtection );
+
+ m_aChangeProtectionPB.Enable( !bIsReadonly );
// set the right text
- if (bVal)
+ if (bProtection)
sNewText = m_aUnProtectSTR;
+
+ m_aRecordChangesCB.Check( bRecordChanges );
+ m_aRecordChangesCB.Enable( /*!bProtection && */!bIsReadonly );
+
+ DBG_ASSERT( pCurDocShell, "doc shell missing" );
+ if (pCurDocShell)
+ {
+ m_bOrigPasswordIsConfirmed = true; // default case if no password is set
+ uno::Sequence< sal_Int8 > aPasswordHash;
+ // check if password is available
+ if (pCurDocShell->GetProtectionHash( aPasswordHash ) &&
+ aPasswordHash.getLength() > 0)
+ m_bOrigPasswordIsConfirmed = false; // password found, needs to be confirmed later on
+ }
}
}
@@ -310,27 +350,94 @@ void SfxSecurityPage_Impl::Reset_Impl( const SfxItemSet & )
IMPL_LINK( SfxSecurityPage_Impl, RecordChangesCBHdl, void*, EMPTYARG )
{
- ExecuteRecordChangesFunc( m_eRedlingMode, RF_ON, m_aRecordChangesCB.IsChecked(), &m_rDialog );
- CheckRecordChangesState();
+ // when change recording gets disabled protection must be disabled as well
+ if (!m_aRecordChangesCB.IsChecked()) // the new check state is already present, thus the '!'
+ {
+ bool bAlreadyDone = false;
+ if (!m_bEndRedliningWarningDone)
+ {
+ WarningBox aBox( m_rMyTabPage.GetParent(), WinBits(WB_YES_NO | WB_DEF_NO),
+ m_aEndRedliningWarning );
+ if (aBox.Execute() != RET_YES)
+ bAlreadyDone = true;
+ else
+ m_bEndRedliningWarningDone = true;
+ }
+
+ const bool bNeedPasssword = !m_bOrigPasswordIsConfirmed
+ && m_aChangeProtectionPB.GetText() != m_aProtectSTR;
+ if (!bAlreadyDone && bNeedPasssword)
+ {
+ String aPasswordText;
+
+ // dialog canceled or no password provided
+ if (!lcl_GetPassword( m_rMyTabPage.GetParent(), false, aPasswordText ))
+ bAlreadyDone = true;
+
+ // ask for password and if dialog is canceled or no password provided return
+ if (lcl_IsPasswordCorrect( aPasswordText ))
+ m_bOrigPasswordIsConfirmed = true;
+ else
+ bAlreadyDone = true;
+ }
+
+ if (bAlreadyDone)
+ m_aRecordChangesCB.Check( true ); // restore original state
+ else
+ {
+ // remember required values to change protection and change recording in
+ // FillItemSet_Impl later on if password was correct.
+ m_bNewPasswordIsValid = true;
+ m_aNewPassword = String();
+
+ m_aChangeProtectionPB.SetText( m_aProtectSTR );
+ }
+ }
+
return 0;
}
IMPL_LINK( SfxSecurityPage_Impl, ChangeProtectionPBHdl, void*, EMPTYARG )
{
- bool bProt;
- QueryRecordChangesProtectionState( m_eRedlingMode, bProt );
- ExecuteRecordChangesFunc( m_eRedlingMode, RF_PROTECT, !bProt, &m_rDialog );
- CheckRecordChangesState();
+ if (m_eRedlingMode == RL_NONE)
+ return 0;
+
+ // the push button text is always the opposite of the current state. Thus:
+ const bool bCurrentProtection = m_aChangeProtectionPB.GetText() != m_aProtectSTR;
- if (QueryRecordChangesProtectionState( m_eRedlingMode, bProt ))
+ // ask user for password (if still necessary)
+ String aPasswordText;
+ bool bNewProtection = !bCurrentProtection;
+ const bool bNeedPassword = bNewProtection || !m_bOrigPasswordIsConfirmed;
+ if (bNeedPassword)
{
- // RecordChangesCB is enabled if protection is off
- m_aRecordChangesCB.Enable( !bProt );
- // toggle text of button "Protect" <-> "Unprotect"
- String sNewText = bProt ? m_aUnProtectSTR : m_aProtectSTR;
- m_aChangeProtectionPB.SetText( sNewText );
+ // ask for password and if dialog is canceled or no password provided return
+ if (!lcl_GetPassword( m_rMyTabPage.GetParent(), bNewProtection, aPasswordText ))
+ return 0;
+
+ // provided password still needs to be checked?
+ if (!bNewProtection && !m_bOrigPasswordIsConfirmed)
+ {
+ if (lcl_IsPasswordCorrect( aPasswordText ))
+ m_bOrigPasswordIsConfirmed = true;
+ else
+ return 0;
+ }
}
+ DBG_ASSERT( m_bOrigPasswordIsConfirmed, "ooops... this should not have happened!" );
+
+ // remember required values to change protection and change recording in
+ // FillItemSet_Impl later on if password was correct.
+ m_bNewPasswordIsValid = true;
+ m_aNewPassword = bNewProtection? aPasswordText : String();
+
+// // RecordChangesCB is enabled if protection is off
+// m_aRecordChangesCB.Enable( !bNewProtection );
+ m_aRecordChangesCB.Check( bNewProtection );
+ // toggle text of button "Protect" <-> "Unprotect"
+ m_aChangeProtectionPB.SetText( bNewProtection ? m_aUnProtectSTR : m_aProtectSTR );
+
return 0;
}
@@ -378,3 +485,4 @@ void SfxSecurityPage::Reset( const SfxItemSet & rItemSet )
//////////////////////////////////////////////////////////////////////
+
diff --git a/sfx2/source/dialog/securitypage.hrc b/sfx2/source/dialog/securitypage.hrc
index 820dab538b9f..d425131b4772 100755
--- a/sfx2/source/dialog/securitypage.hrc
+++ b/sfx2/source/dialog/securitypage.hrc
@@ -41,12 +41,12 @@
#define CONFIRM_PASSWORD_TO_MODIFY_ED 11
#define OPTIONS_FL 12
#define OPEN_READONLY_CB 13
-#define REMOVE_INFO_ON_SAVING_CB 14
-#define RECORD_CHANGES_CB 15
-#define CHANGE_PROTECTION_PB 16
+#define RECORD_CHANGES_CB 14
+#define CHANGE_PROTECTION_PB 15
#define STR_PROTECT 101
#define STR_UNPROTECT 102
+#define STR_END_REDLINING_WARNING 103
#endif
diff --git a/sfx2/source/dialog/securitypage.src b/sfx2/source/dialog/securitypage.src
index 32f5fac704a4..4bf8cdaf58a9 100755
--- a/sfx2/source/dialog/securitypage.src
+++ b/sfx2/source/dialog/securitypage.src
@@ -125,21 +125,15 @@ TabPage TP_DOCINFOSECURITY
Size = MAP_APPFONT( 176, RSC_CD_CHECKBOX_HEIGHT );
Text [ en-US ] = "~Open file read-only";
};
- CheckBox REMOVE_INFO_ON_SAVING_CB
- {
- Pos = MAP_APPFONT( 12, 147 );
- Size = MAP_APPFONT( 176, RSC_CD_CHECKBOX_HEIGHT );
- Text [ en-US ] = "Remove personal ~information on saving";
- };
CheckBox RECORD_CHANGES_CB
{
- Pos = MAP_APPFONT( 12, 162 );
+ Pos = MAP_APPFONT( 12, 147 );
Size = MAP_APPFONT( 176, RSC_CD_CHECKBOX_HEIGHT );
Text [ en-US ] = "Record ~changes";
};
PushButton CHANGE_PROTECTION_PB
{
- Pos = MAP_APPFONT( 194, 160 );
+ Pos = MAP_APPFONT( 194, 145 );
Size = MAP_APPFONT( 60, RSC_CD_PUSHBUTTON_HEIGHT );
};
String STR_PROTECT
@@ -150,7 +144,14 @@ TabPage TP_DOCINFOSECURITY
{
Text [ en-US ] = "~Unprotect...";
};
-
+ String STR_END_REDLINING_WARNING
+ {
+ Text [ en-US ] = "This action will exit the change recording mode.\nAny information about changes will be lost.\n\nExit change recording mode?\n\n" ;
+ };
};
+String RID_SFX_INCORRECT_PASSWORD
+{
+ Text [ en-US ] = "Incorrect password" ;
+};
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 6502eeaeb78c..751525910958 100644..100755
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -1074,3 +1074,27 @@ void SfxObjectShell::SetInitialized_Impl( const bool i_fromInitNew )
SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_LOADFINISHED, GlobalEventConfig::GetEventName(STR_EVENT_LOADFINISHED), this ) );
}
}
+
+
+void SfxObjectShell::SetChangeRecording( bool /*bActivate*/ )
+{
+ // currently this function needs to be overwritten by Writer and Calc only
+ DBG_ASSERT( 0, "function not implemented" );
+}
+
+
+bool SfxObjectShell::SetProtectionPassword( const String &rPassword )
+{
+ // currently this function needs to be overwritten by Writer and Calc only
+ DBG_ASSERT( 0, "function not implemented" );
+ return false;
+}
+
+
+bool SfxObjectShell::GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal_Int8 > & /*rPasswordHash*/ )
+{
+ // currently this function needs to be overwritten by Writer and Calc only
+ DBG_ASSERT( 0, "function not implemented" );
+ return false;
+}
+