[ooo-build-commit] .: cui/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Tue Oct 5 07:21:20 PDT 2010
cui/source/options/optgdlg.cxx | 18 ++++++++++++++----
cui/source/options/optgdlg.hrc | 4 +++-
cui/source/options/optgdlg.hxx | 1 +
cui/source/options/optgdlg.src | 14 ++++++++++----
4 files changed, 28 insertions(+), 9 deletions(-)
New commits:
commit 46e8e662367b15cbbd567f941a3e0604170eb11b
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Tue Oct 5 10:14:20 2010 -0400
Ported always-save-option-svx.diff from ooo-build.
Add new option in the Options dialog to allow document save even when
the document has not been "modified".
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index f532b5b..f080d21 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -210,6 +210,7 @@ OfaMiscTabPage::OfaMiscTabPage(Window* pParent, const SfxItemSet& rSet ) :
aPrintDlgCB ( this, CUI_RES( CB_PRINTDLG ) ),
aDocStatusFL ( this, CUI_RES( FL_DOCSTATUS ) ),
aDocStatusCB ( this, CUI_RES( CB_DOCSTATUS ) ),
+ aSaveAlwaysCB ( this, CUI_RES( CB_SAVE_ALWAYS ) ),
aTwoFigureFL ( this, CUI_RES( FL_TWOFIGURE ) ),
aInterpretFT ( this, CUI_RES( FT_INTERPRET ) ),
aYearValueField ( this, CUI_RES( NF_YEARVALUE ) ),
@@ -240,7 +241,7 @@ OfaMiscTabPage::OfaMiscTabPage(Window* pParent, const SfxItemSet& rSet ) :
Window* pWins[] =
{
- &aDocStatusFL, &aDocStatusCB, &aTwoFigureFL,
+ &aDocStatusFL, &aDocStatusCB, &aSaveAlwaysCB, &aTwoFigureFL,
&aInterpretFT, &aYearValueField, &aToYearFT
};
Window** pCurrent = pWins;
@@ -262,8 +263,8 @@ OfaMiscTabPage::OfaMiscTabPage(Window* pParent, const SfxItemSet& rSet ) :
Window* pWins[] =
{
- &aPrintDlgFL, &aPrintDlgCB, &aDocStatusFL, &aDocStatusCB, &aTwoFigureFL,
- &aInterpretFT, &aYearValueField, &aToYearFT
+ &aPrintDlgFL, &aPrintDlgCB, &aDocStatusFL, &aDocStatusCB, &aSaveAlwaysCB,
+ &aTwoFigureFL, &aInterpretFT, &aYearValueField, &aToYearFT
};
Window** pCurrent = pWins;
const sal_Int32 nCount = sizeof( pWins ) / sizeof( pWins[ 0 ] );
@@ -288,7 +289,7 @@ OfaMiscTabPage::OfaMiscTabPage(Window* pParent, const SfxItemSet& rSet ) :
Window* pWins[] =
{
- &aDocStatusFL, &aDocStatusCB, &aTwoFigureFL,
+ &aDocStatusFL, &aDocStatusCB, &aSaveAlwaysCB, &aTwoFigureFL,
&aInterpretFT, &aYearValueField, &aToYearFT
};
Window** pCurrent = pWins;
@@ -419,6 +420,13 @@ BOOL OfaMiscTabPage::FillItemSet( SfxItemSet& rSet )
bModified = TRUE;
}
+ if ( aSaveAlwaysCB.IsChecked() != aSaveAlwaysCB.GetSavedValue() )
+ {
+ SvtMiscOptions aMiscOpt;
+ aMiscOpt.SetSaveAlwaysAllowed( aSaveAlwaysCB.IsChecked() );
+ bModified = TRUE;
+ }
+
const SfxUInt16Item* pUInt16Item =
PTR_CAST( SfxUInt16Item, GetOldItem( rSet, SID_ATTR_YEAR2000 ) );
USHORT nNum = (USHORT)aYearValueField.GetText().ToInt32();
@@ -460,6 +468,8 @@ void OfaMiscTabPage::Reset( const SfxItemSet& rSet )
aFileDlgCB.SaveValue();
aPrintDlgCB.Check( !aMiscOpt.UseSystemPrintDialog() );
aPrintDlgCB.SaveValue();
+ aSaveAlwaysCB.Check( aMiscOpt.IsSaveAlwaysAllowed() );
+ aSaveAlwaysCB.SaveValue();
aODMADlgCB.Check( aMiscOpt.TryODMADialog() );
aODMADlgCB.SaveValue();
diff --git a/cui/source/options/optgdlg.hrc b/cui/source/options/optgdlg.hrc
index db1ded0..4f57a23 100644
--- a/cui/source/options/optgdlg.hrc
+++ b/cui/source/options/optgdlg.hrc
@@ -56,7 +56,8 @@
#define ROW9 (ROW8+RSC_CD_CHECKBOX_HEIGHT+ROWSPACE)
#define ROW10 (ROW9+RSC_CD_FIXEDLINE_HEIGHT+ROWSPACE)
#define ROW11 (ROW10+RSC_CD_CHECKBOX_HEIGHT+ROWSPACE)
-#define ROW12 (ROW11+RSC_CD_FIXEDLINE_HEIGHT+ROWSPACE)
+#define ROW12 (ROW11+RSC_CD_CHECKBOX_HEIGHT+ROWSPACE)
+#define ROW13 (ROW12+RSC_CD_FIXEDLINE_HEIGHT+ROWSPACE)
#define DIFF(v1,v2) (v2-v1)
#define OFFS_TEXTBOX_FIXEDTEXT(base) (base+(RSC_CD_TEXTBOX_HEIGHT-RSC_CD_FIXEDTEXT_HEIGHT)/2)
@@ -201,6 +202,7 @@
#define FL_DOCSTATUS 60
#define CB_DOCSTATUS 61
#define CB_ODMADLG 62
+#define CB_SAVE_ALWAYS 74
#endif // #ifndef _SVX_OPTGDLG_HRC
// ******************************************************************* EOF
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index 5b51490..24b549c 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -63,6 +63,7 @@ private:
FixedLine aDocStatusFL;
CheckBox aDocStatusCB;
+ CheckBox aSaveAlwaysCB;
FixedLine aTwoFigureFL;
FixedText aInterpretFT;
diff --git a/cui/source/options/optgdlg.src b/cui/source/options/optgdlg.src
index a0db825..612e215 100644
--- a/cui/source/options/optgdlg.src
+++ b/cui/source/options/optgdlg.src
@@ -131,22 +131,28 @@ TabPage OFA_TP_MISC
Size = MAP_APPFONT( WHOLE_WIDTH - COL1, RSC_CD_CHECKBOX_HEIGHT );
Text [ en-US ] = "~Printing sets \"document modified\" status";
};
+ CheckBox CB_SAVE_ALWAYS
+ {
+ Pos = MAP_APPFONT( COL1, ROW11 );
+ Size = MAP_APPFONT( WHOLE_WIDTH - COL1, RSC_CD_CHECKBOX_HEIGHT );
+ Text [ en-US ] = "Allow to save document even when the document is not modified";
+ };
FixedLine FL_TWOFIGURE
{
- Pos = MAP_APPFONT( COL0, ROW11 );
+ Pos = MAP_APPFONT( COL0, ROW12 );
Size = MAP_APPFONT( WHOLE_WIDTH, RSC_CD_FIXEDLINE_HEIGHT );
Text [ en-US ] = "Year (two digits)" ;
};
FixedText FT_INTERPRET
{
- Pos = MAP_APPFONT( COL1, OFFS_TEXTBOX_FIXEDTEXT(ROW12) );
+ Pos = MAP_APPFONT( COL1, OFFS_TEXTBOX_FIXEDTEXT(ROW13) );
Size = MAP_APPFONT( DIFF( COL1, COL3), RSC_CD_FIXEDTEXT_HEIGHT );
Text [ en-US ] = "Interpret as years between";
};
NumericField NF_YEARVALUE
{
Border = TRUE ;
- Pos = MAP_APPFONT( COL4, ROW12 );
+ Pos = MAP_APPFONT( COL4, ROW13 );
Size = MAP_APPFONT( EDIT_WIDTH, RSC_CD_TEXTBOX_HEIGHT );
Minimum = 1583 ;
Maximum = 9857 ;
@@ -155,7 +161,7 @@ TabPage OFA_TP_MISC
};
FixedText FT_TOYEAR
{
- Pos = MAP_APPFONT( COL6, OFFS_TEXTBOX_FIXEDTEXT(ROW12) );
+ Pos = MAP_APPFONT( COL6, OFFS_TEXTBOX_FIXEDTEXT(ROW13) );
Size = MAP_APPFONT( WHOLE_WIDTH - COL6, RSC_CD_FIXEDTEXT_HEIGHT );
Text [ en-US ] = "and " ;
};
More information about the ooo-build-commit
mailing list