Author: jsc
Date: Thu Jun 12 12:46:11 2014
New Revision: 1602143
URL: http://svn.apache.org/r1602143
Log:
#125083# add new checkbox in options dialog load/save-general to enable ODF 1.2
encryption AES-256
Modified:
openoffice/trunk/main/cui/source/options/optsave.cxx
openoffice/trunk/main/cui/source/options/optsave.hrc
openoffice/trunk/main/cui/source/options/optsave.hxx
openoffice/trunk/main/cui/source/options/optsave.src
openoffice/trunk/main/cui/source/options/treeopt.cxx
openoffice/trunk/main/helpcontent2/helpers/help_hid.lst
openoffice/trunk/main/helpcontent2/source/text/shared/optionen/01010200.xhp
openoffice/trunk/main/sfx2/inc/sfx2/sfxsids.hrc
openoffice/trunk/main/sfx2/source/appl/appcfg.cxx
Modified: openoffice/trunk/main/cui/source/options/optsave.cxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/cui/source/options/optsave.cxx?rev=1602143&r1=1602142&r2=1602143&view=diff
==============================================================================
--- openoffice/trunk/main/cui/source/options/optsave.cxx (original)
+++ openoffice/trunk/main/cui/source/options/optsave.cxx Thu Jun 12 12:46:11
2014
@@ -178,6 +178,7 @@ SfxSaveTabPage::SfxSaveTabPage( Window*
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( Sf
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 SfxIte
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 SfxIte
aDocInfoCB.SaveValue();
aBackupCB.SaveValue();
aWarnAlienFormatCB.SaveValue();
+ aODFEncryptionCB.SaveValue();
aSizeOptimizationCB.SaveValue();
aAutoSaveCB.SaveValue();
aAutoSaveEdit.SaveValue();
Modified: openoffice/trunk/main/cui/source/options/optsave.hrc
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/cui/source/options/optsave.hrc?rev=1602143&r1=1602142&r2=1602143&view=diff
==============================================================================
--- openoffice/trunk/main/cui/source/options/optsave.hrc (original)
+++ openoffice/trunk/main/cui/source/options/optsave.hrc Thu Jun 12 12:46:11
2014
@@ -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
Modified: openoffice/trunk/main/cui/source/options/optsave.hxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/cui/source/options/optsave.hxx?rev=1602143&r1=1602142&r2=1602143&view=diff
==============================================================================
--- openoffice/trunk/main/cui/source/options/optsave.hxx (original)
+++ openoffice/trunk/main/cui/source/options/optsave.hxx Thu Jun 12 12:46:11
2014
@@ -66,6 +66,7 @@ private:
FixedLine aDefaultFormatFL;
FixedText aODFVersionFT;
ListBox aODFVersionLB;
+ CheckBox aODFEncryptionCB;
CheckBox aSizeOptimizationCB;
CheckBox aWarnAlienFormatCB;
FixedText aDocTypeFT;
Modified: openoffice/trunk/main/cui/source/options/optsave.src
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/cui/source/options/optsave.src?rev=1602143&r1=1602142&r2=1602143&view=diff
==============================================================================
--- openoffice/trunk/main/cui/source/options/optsave.src (original)
+++ openoffice/trunk/main/cui/source/options/optsave.src Thu Jun 12 12:46:11
2014
@@ -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.";
Modified: openoffice/trunk/main/cui/source/options/treeopt.cxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/cui/source/options/treeopt.cxx?rev=1602143&r1=1602142&r2=1602143&view=diff
==============================================================================
--- openoffice/trunk/main/cui/source/options/treeopt.cxx (original)
+++ openoffice/trunk/main/cui/source/options/treeopt.cxx Thu Jun 12 12:46:11
2014
@@ -1627,6 +1627,7 @@ SfxItemSet* OfaTreeOptionsDialog::Create
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;
Modified: openoffice/trunk/main/helpcontent2/helpers/help_hid.lst
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/helpcontent2/helpers/help_hid.lst?rev=1602143&r1=1602142&r2=1602143&view=diff
==============================================================================
--- openoffice/trunk/main/helpcontent2/helpers/help_hid.lst (original)
+++ openoffice/trunk/main/helpcontent2/helpers/help_hid.lst Thu Jun 12 12:46:11
2014
@@ -8141,6 +8141,7 @@ svx_CheckBox_RID_SFXPAGE_GENERAL_CB_USED
svx_CheckBox_RID_SFXPAGE_SAVE_BTN_AUTOSAVE,733479952,
svx_CheckBox_RID_SFXPAGE_SAVE_BTN_BACKUP,733479951,
svx_CheckBox_RID_SFXPAGE_SAVE_BTN_DOCINFO,733479950,
+svx_CheckBox_RID_SFXPAGE_SAVE_BTN_ODFENCRYPTION,733479953,
svx_CheckBox_RID_SFXPAGE_SAVE_BTN_NOPRETTYPRINTING,733479956,
svx_CheckBox_RID_SFXPAGE_SAVE_BTN_RELATIVE_FSYS,733479977,
svx_CheckBox_RID_SFXPAGE_SAVE_BTN_RELATIVE_INET,733479978,
Modified:
openoffice/trunk/main/helpcontent2/source/text/shared/optionen/01010200.xhp
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/helpcontent2/source/text/shared/optionen/01010200.xhp?rev=1602143&r1=1602142&r2=1602143&view=diff
==============================================================================
--- openoffice/trunk/main/helpcontent2/source/text/shared/optionen/01010200.xhp
(original)
+++ openoffice/trunk/main/helpcontent2/source/text/shared/optionen/01010200.xhp
Thu Jun 12 12:46:11 2014
@@ -151,6 +151,10 @@
<paragraph xml-lang="en-US" id="par_id8892483" role="paragraph"
l10n="NEW">When you save a document, you can select whether to save the
document in the format ODF 1.2, ODF 1.2 (Extended), or in the prior format ODF
1.0/1.1.</paragraph>
<paragraph xml-lang="en-US" id="par_id0915200911205367" role="note"
l10n="NEW">Currently, the ODF 1.2 (Extended) format enables files of Draw and
Impress to contain comments. Those comments can be inserted by <item
type="menuitem">Insert - Comment</item> in the latest software version. The
comments get lost when loading files into prior software versions that were
saved by the latest software version.</paragraph>
<paragraph xml-lang="en-US" id="par_id7198400" role="paragraph"
l10n="CHG"><ahelp hid=".">Some companies or organizations may require ODF
documents in the ODF 1.0/1.1 format. You can select that format to save in the
listbox. This older format cannot store all new features, so the new format ODF
1.2 (Extended) is recommended where possible.</ahelp></paragraph>
+<bookmark xml-lang="en-US"
branch="hid/cui:CheckBox:RID_SFXPAGE_SAVE:BTN_ODFENCRYPTION" id="bm_id3165414"
localize="false"/>
+<paragraph xml-lang="en-US" id="hd_id3164920" role="heading" level="3"
l10n="NEW"
+ oldref="77">File encryption algorithm for ODF 1.2
format</paragraph>
+ <paragraph xml-lang="en-US" id="par_id3160488" role="paragraph" l10n="U"
oldref="78"><ahelp hid="SVX_CHECKBOX_RID_SFXPAGE_SAVE_BTN_ODFENCRYPTION">Change
the default file encryption from blowfish to AES-256 when ODF 1.2 is
used.</ahelp> The default file encryption algorithm is blowfish but when ODF
1.2 is used the user can change the default to AES-256. Older encrypted
documents can still be loaded but new encrypted documents can't be opened with
older office versions. The AES-256 algorithm is more secure than
blowfish.</paragraph>
<bookmark xml-lang="en-US"
branch="hid/cui:CheckBox:RID_SFXPAGE_SAVE:BTN_NOPRETTYPRINTING"
id="bm_id3155414" localize="false"/>
<paragraph xml-lang="en-US" id="hd_id3154920" role="heading" level="3"
l10n="CHG"
oldref="77">Size optimization for ODF format</paragraph>
@@ -169,4 +173,4 @@
oldref="51">Always save as</paragraph>
<paragraph xml-lang="en-US" id="par_id3149035" role="paragraph" l10n="U"
oldref="64"><ahelp hid="SVX_LISTBOX_RID_SFXPAGE_SAVE_LB_FILTER">Specifies how
documents of the type selected on the left will always be saved as this file
type. You may select another file type for the current document in the
<emph>Save as</emph> dialog.</ahelp></paragraph>
</body>
-</helpdocument>
\ No newline at end of file
+</helpdocument>
Modified: openoffice/trunk/main/sfx2/inc/sfx2/sfxsids.hrc
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/inc/sfx2/sfxsids.hrc?rev=1602143&r1=1602142&r2=1602143&view=diff
==============================================================================
--- openoffice/trunk/main/sfx2/inc/sfx2/sfxsids.hrc (original)
+++ openoffice/trunk/main/sfx2/inc/sfx2/sfxsids.hrc Thu Jun 12 12:46:11 2014
@@ -835,8 +835,9 @@
#define SID_OPT_FONT_ANTIALIASING_MINPIXELS (SID_OPTIONS_START + 96)
//middle mouse button
#define SID_OPT_MIDDLE_MOUSE (SID_OPTIONS_START + 97)
-#define SID_ATTR_PRETTYPRINTING
(SID_OPTIONS_START + 98)
+#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) ---------------------------------------------
Modified: openoffice/trunk/main/sfx2/source/appl/appcfg.cxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/appl/appcfg.cxx?rev=1602143&r1=1602142&r2=1602143&view=diff
==============================================================================
--- openoffice/trunk/main/sfx2/source/appl/appcfg.cxx (original)
+++ openoffice/trunk/main/sfx2/source/appl/appcfg.cxx Thu Jun 12 12:46:11 2014
@@ -205,6 +205,16 @@ sal_Bool SfxApplication::GetOptions( Sfx
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( co
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 ) )
{