cui/source/options/optsave.cxx | 11 +++++++++++ cui/source/options/optsave.hrc | 1 + cui/source/options/optsave.hxx | 1 + cui/source/options/optsave.src | 25 ++++++++++++++++--------- cui/source/options/treeopt.cxx | 1 + sfx2/inc/sfx2/sfxsids.hrc | 1 + sfx2/source/appl/appcfg.cxx | 20 ++++++++++++++++++++ 7 files changed, 51 insertions(+), 9 deletions(-)
New commits: commit f5d074090c8cf24a27e610d1dc70e8d6af68cc88 Author: Jürgen Schmidt <[email protected]> Date: Thu Jun 12 12:46:11 2014 +0000 #125083# add new checkbox in options dialog load/save-general to enable ODF 1.2 encryption AES-256 diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx index 99d58e6..c71a1ee 100644 --- a/cui/source/options/optsave.cxx +++ b/cui/source/options/optsave.cxx @@ -178,6 +178,7 @@ SfxSaveTabPage::SfxSaveTabPage( Window* pParent, const SfxItemSet& rCoreSet ) : aDefaultFormatFL ( this, CUI_RES( FL_FILTER ) ), aODFVersionFT ( this, CUI_RES( FT_ODF_VERSION ) ), aODFVersionLB ( this, CUI_RES( LB_ODF_VERSION ) ), + aODFEncryptionCB ( this, CUI_RES( BTN_ODFENCRYPTION ) ), aSizeOptimizationCB ( this, CUI_RES( BTN_NOPRETTYPRINTING ) ), aWarnAlienFormatCB ( this, CUI_RES( BTN_WARNALIENFORMAT ) ), aDocTypeFT ( this, CUI_RES( FT_APP ) ), @@ -384,6 +385,12 @@ sal_Bool SfxSaveTabPage::FillItemSet( SfxItemSet& rSet ) bModified |= sal_True; } + if ( aODFEncryptionCB.IsChecked() != aODFEncryptionCB.GetSavedValue() ) + { + rSet.Put( SfxBoolItem( GetWhich( SID_ATTR_ODFENCRYPTION ), aODFEncryptionCB.IsChecked() ) ); + bModified |= sal_True; + } + if ( aSizeOptimizationCB.IsChecked() != aSizeOptimizationCB.GetSavedValue() ) { rSet.Put( SfxBoolItem( GetWhich( SID_ATTR_PRETTYPRINTING ), !aSizeOptimizationCB.IsChecked() ) ); @@ -596,6 +603,9 @@ void SfxSaveTabPage::Reset( const SfxItemSet& ) aWarnAlienFormatCB.Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_WARNALIENFORMAT)); // aAutoSaveCB.Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_AUTOSAVE)); + // ODF encryption + aODFEncryptionCB.Check( !aSaveOpt.IsUseSHA1InODF12()); + // the pretty printing aSizeOptimizationCB.Check( !aSaveOpt.IsPrettyPrinting()); // aSizeOptimizationCB.Enable(!aSaveOpt.IsReadOnly(SvtSaveOptions::E_DOPRETTYPRINTING )); @@ -620,6 +630,7 @@ void SfxSaveTabPage::Reset( const SfxItemSet& ) aDocInfoCB.SaveValue(); aBackupCB.SaveValue(); aWarnAlienFormatCB.SaveValue(); + aODFEncryptionCB.SaveValue(); aSizeOptimizationCB.SaveValue(); aAutoSaveCB.SaveValue(); aAutoSaveEdit.SaveValue(); diff --git a/cui/source/options/optsave.hrc b/cui/source/options/optsave.hrc index a637f4a..e705793 100644 --- a/cui/source/options/optsave.hrc +++ b/cui/source/options/optsave.hrc @@ -40,6 +40,7 @@ #define BTN_WARNALIENFORMAT 22 #define FT_ODF_VERSION 23 #define LB_ODF_VERSION 24 +#define BTN_ODFENCRYPTION 25 #define GB_RELATIVE 40 #define BTN_RELATIVE_FSYS 41 diff --git a/cui/source/options/optsave.hxx b/cui/source/options/optsave.hxx index a2e2c5d..cf5d7e4 100644 --- a/cui/source/options/optsave.hxx +++ b/cui/source/options/optsave.hxx @@ -66,6 +66,7 @@ private: FixedLine aDefaultFormatFL; FixedText aODFVersionFT; ListBox aODFVersionLB; + CheckBox aODFEncryptionCB; CheckBox aSizeOptimizationCB; CheckBox aWarnAlienFormatCB; FixedText aDocTypeFT; diff --git a/cui/source/options/optsave.src b/cui/source/options/optsave.src index 4ab58c7..892cf7b 100644 --- a/cui/source/options/optsave.src +++ b/cui/source/options/optsave.src @@ -156,36 +156,43 @@ TabPage RID_SFXPAGE_SAVE < "1.2 Extended (recommended)"; 0x7fffffff ; > ; }; }; + CheckBox BTN_ODFENCRYPTION + { + HelpID = "cui:CheckBox:RID_SFXPAGE_SAVE:BTN_ODFENCRYPTION"; + Pos = MAP_APPFONT ( 12 , 120 ) ; + Size = MAP_APPFONT ( 248 , 10 ) ; + Text [ en-US ] = "Enable AES-256 encryption (ODF 1.2)" ; + }; CheckBox BTN_NOPRETTYPRINTING { HelpID = "cui:CheckBox:RID_SFXPAGE_SAVE:BTN_NOPRETTYPRINTING"; - Pos = MAP_APPFONT ( 12 , 120 ) ; + Pos = MAP_APPFONT ( 12 , 131 ) ; Size = MAP_APPFONT ( 248 , 10 ) ; Text [ en-US ] = "Size optimization for ODF format" ; }; CheckBox BTN_WARNALIENFORMAT { HelpID = "cui:CheckBox:RID_SFXPAGE_SAVE:BTN_WARNALIENFORMAT"; - Pos = MAP_APPFONT ( 12 , 131 ) ; + Pos = MAP_APPFONT ( 12 , 142 ) ; Size = MAP_APPFONT ( 248 , 10 ) ; Text [ en-US ] = "Warn when not saving in ODF or default format" ; }; FixedText FT_APP { - Pos = MAP_APPFONT ( 12 , 142 ) ; + Pos = MAP_APPFONT ( 12 , 153 ) ; Size = MAP_APPFONT ( 120 , 8 ) ; Text [ en-US ] = "D~ocument type"; }; FixedText FT_FILTER { - Pos = MAP_APPFONT ( 136 , 142 ) ; + Pos = MAP_APPFONT ( 136 , 153 ) ; Size = MAP_APPFONT ( 120 , 8 ) ; Text [ en-US ] = "Always sa~ve as"; }; ListBox LB_APP { HelpID = "cui:ListBox:RID_SFXPAGE_SAVE:LB_APP"; - Pos = MAP_APPFONT ( 12 , 153 ) ; + Pos = MAP_APPFONT ( 12 , 164 ) ; Size = MAP_APPFONT ( 108 , 58 ) ; Border = TRUE; DropDown = TRUE; @@ -202,14 +209,14 @@ TabPage RID_SFXPAGE_SAVE }; FixedImage FI_FILTER { - Pos = MAP_APPFONT ( 129, 154 ) ; + Pos = MAP_APPFONT ( 129, 153 ) ; Size = MAP_APPFONT ( 6 , 6 ) ; Hide = TRUE; }; ListBox LB_FILTER { HelpID = "cui:ListBox:RID_SFXPAGE_SAVE:LB_FILTER"; - Pos = MAP_APPFONT ( 136 , 153 ) ; + Pos = MAP_APPFONT ( 136 , 164 ) ; Size = MAP_APPFONT ( 108 , 58 ) ; Border = TRUE; Sort = TRUE; @@ -217,13 +224,13 @@ TabPage RID_SFXPAGE_SAVE }; FixedImage FI_ODF_WARNING { - Pos = MAP_APPFONT ( 12, 169 ) ; + Pos = MAP_APPFONT ( 12, 180 ) ; Size = MAP_APPFONT ( 8 , 8 ) ; Hide = TRUE; }; FixedText FT_WARN { - Pos = MAP_APPFONT ( 23 , 169 ) ; + Pos = MAP_APPFONT ( 23 , 180 ) ; Size = MAP_APPFONT ( 239 , 8 ) ; Hide = TRUE; Text [ en-US ] = "Not using ODF 1.2 Extended may cause information to be lost."; diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index e8df439..6762083 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -1627,6 +1627,7 @@ SfxItemSet* OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId ) SID_SAVEREL_INET, SID_SAVEREL_FSYS, SID_ATTR_PRETTYPRINTING, SID_ATTR_PRETTYPRINTING, SID_ATTR_WARNALIENFORMAT, SID_ATTR_WARNALIENFORMAT, + SID_ATTR_ODFENCRYPTION, SID_ATTR_ODFENCRYPTION, 0 ); SFX_APP()->GetOptions(*pRet); break; diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc index 2b5e804..801e18e 100644 --- a/sfx2/inc/sfx2/sfxsids.hrc +++ b/sfx2/inc/sfx2/sfxsids.hrc @@ -837,6 +837,7 @@ #define SID_OPT_MIDDLE_MOUSE (SID_OPTIONS_START + 97) #define SID_ATTR_PRETTYPRINTING (SID_OPTIONS_START + 98) #define SID_HELP_STYLESHEET (SID_OPTIONS_START + 99) +#define SID_ATTR_ODFENCRYPTION (SID_OPTIONS_START + 100) // slot IDs from SVX (svxids.hrc) --------------------------------------------- diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx index 71e0442..324b3ba 100644 --- a/sfx2/source/appl/appcfg.cxx +++ b/sfx2/source/appl/appcfg.cxx @@ -205,6 +205,16 @@ sal_Bool SfxApplication::GetOptions( SfxItemSet& rSet ) bRet = sal_False; } break; + case SID_ATTR_ODFENCRYPTION: + { + bRet = sal_True; + if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_USESHA1INODF12) && + !aSaveOptions.IsReadOnly(SvtSaveOptions::E_USEBLOWFISHINODF12)) + if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_ODFENCRYPTION ), + !(aSaveOptions.IsUseSHA1InODF12() && aSaveOptions.IsUseBlowfishInODF12())))) + bRet = sal_False; + } + break; case SID_ATTR_PRETTYPRINTING: { bRet = sal_True; @@ -563,6 +573,16 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) aSaveOptions.SetBackup( ( (const SfxBoolItem*)pItem )->GetValue() ); } + // ODF Encryption + if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_ATTR_ODFENCRYPTION ), sal_True, &pItem ) ) + { + DBG_ASSERT( pItem->ISA( SfxBoolItem ), "BoolItem expected" ); + sal_Bool bItemValue = static_cast< const SfxBoolItem*>(pItem)->GetValue(); + + aSaveOptions.SetUseSHA1InODF12( !bItemValue ); + aSaveOptions.SetUseBlowfishInODF12( !bItemValue ); + } + // PrettyPrinting if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_ATTR_PRETTYPRINTING ), sal_True, &pItem ) ) {
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
