Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
89589859
Kaydet (Commit)
89589859
authored
Şub 26, 2013
tarafından
Krisztian Pinter
Kaydeden (comit)
Jan Holesovsky
Mar 07, 2013
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
WIP: fdo#47011 autosave feature
Change-Id: Ib2cbcc33e6188c60c183b5f47e9ae9c9d4c91b95
üst
98645ae6
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
181 additions
and
20 deletions
+181
-20
optsave.cxx
cui/source/options/optsave.cxx
+28
-3
optsave.hrc
cui/source/options/optsave.hrc
+1
-0
optsave.hxx
cui/source/options/optsave.hxx
+1
-0
optsave.src
cui/source/options/optsave.src
+21
-14
autorecovery.hxx
framework/inc/services/autorecovery.hxx
+2
-1
autorecovery.cxx
framework/source/services/autorecovery.cxx
+20
-0
Recovery.xcu
officecfg/registry/data/org/openoffice/Office/Recovery.xcu
+4
-0
Recovery.xcs
officecfg/registry/schema/org/openoffice/Office/Recovery.xcs
+6
-0
sfxsids.hrc
sfx2/inc/sfx2/sfxsids.hrc
+1
-0
appcfg.cxx
sfx2/source/appl/appcfg.cxx
+15
-0
gconfaccess.cxx
shell/source/backends/gconfbe/gconfaccess.cxx
+21
-0
gconfaccess.hxx
shell/source/backends/gconfbe/gconfaccess.hxx
+1
-0
saveopt.hxx
unotools/inc/unotools/saveopt.hxx
+5
-1
saveopt.cxx
unotools/source/config/saveopt.cxx
+55
-1
No files found.
cui/source/options/optsave.cxx
Dosyayı görüntüle @
89589859
...
...
@@ -55,8 +55,9 @@ using namespace comphelper;
#define CFG_PAGE_AND_GROUP OUString("General"), OUString("LoadSave")
// !! you have to update these index, if you changed the list of the child windows !!
#define WININDEX_AUTOSAVE ((sal_uInt16)6)
#define WININDEX_SAVEURL_RELFSYS ((sal_uInt16)9)
#define WININDEX_AUTOSAVE ((sal_uInt16) 6)
#define WININDEX_USERAUTOSAVE ((sal_uInt16) 9)
#define WININDEX_SAVEURL_RELFSYS ((sal_uInt16)10)
// ----------------------------------------------------------------------
...
...
@@ -100,6 +101,7 @@ SfxSaveTabPage::SfxSaveTabPage( Window* pParent, const SfxItemSet& rCoreSet ) :
aAutoSaveCB
(
this
,
CUI_RES
(
BTN_AUTOSAVE
)
),
aAutoSaveEdit
(
this
,
CUI_RES
(
ED_AUTOSAVE
)
),
aMinuteFT
(
this
,
CUI_RES
(
FT_MINUTE
)
),
aUserAutoSaveCB
(
this
,
CUI_RES
(
BTN_USERAUTOSAVE
)
),
aRelativeFsysCB
(
this
,
CUI_RES
(
BTN_RELATIVE_FSYS
)
),
aRelativeInetCB
(
this
,
CUI_RES
(
BTN_RELATIVE_INET
)
),
...
...
@@ -239,12 +241,23 @@ void SfxSaveTabPage::DetectHiddenControls()
aAutoSaveEdit
.
Hide
();
aMinuteFT
.
Hide
();
// the other controls have to move upwards the height of checkbox + space
nDelta
+=
a
RelativeFsys
CB
.
GetPosPixel
().
Y
()
-
aAutoSaveCB
.
GetPosPixel
().
Y
();
nDelta
+=
a
UserAutoSave
CB
.
GetPosPixel
().
Y
()
-
aAutoSaveCB
.
GetPosPixel
().
Y
();
}
else
if
(
nDelta
>
0
)
// the "AutoSave" controls have to move upwards too
nWinIndex
=
WININDEX_AUTOSAVE
;
if
(
aOptionsDlgOpt
.
IsOptionHidden
(
"UserAutoSave"
,
CFG_PAGE_AND_GROUP
)
)
{
// hide controls of "UserAutoSave"
aUserAutoSaveCB
.
Hide
();
// the other controls have to move upwards the height of checkbox + space
nDelta
+=
aRelativeFsysCB
.
GetPosPixel
().
Y
()
-
aUserAutoSaveCB
.
GetPosPixel
().
Y
();
}
else
if
(
nDelta
>
0
)
// the "UserAutoSave" controls have to move upwards too
nWinIndex
=
WININDEX_USERAUTOSAVE
;
if
(
nDelta
>
0
)
{
sal_uInt16
i
,
nChildCount
=
GetChildCount
();
...
...
@@ -315,6 +328,13 @@ sal_Bool SfxSaveTabPage::FillItemSet( SfxItemSet& rSet )
(
sal_uInt16
)
aAutoSaveEdit
.
GetValue
()
)
);
bModified
|=
sal_True
;
}
if
(
aUserAutoSaveCB
.
IsChecked
()
!=
aUserAutoSaveCB
.
GetSavedValue
()
)
{
rSet
.
Put
(
SfxBoolItem
(
GetWhich
(
SID_ATTR_USERAUTOSAVE
),
aUserAutoSaveCB
.
IsChecked
()
)
);
bModified
|=
sal_True
;
}
// save relatively
if
(
aRelativeFsysCB
.
IsChecked
()
!=
aRelativeFsysCB
.
GetSavedValue
()
)
{
...
...
@@ -489,6 +509,7 @@ void SfxSaveTabPage::Reset( const SfxItemSet& )
aBackupFI
.
Show
(
bBackupRO
);
aAutoSaveCB
.
Check
(
aSaveOpt
.
IsAutoSave
());
aUserAutoSaveCB
.
Check
(
aSaveOpt
.
IsUserAutoSave
());
aWarnAlienFormatCB
.
Check
(
aSaveOpt
.
IsWarnAlienFormat
());
aWarnAlienFormatCB
.
Enable
(
!
aSaveOpt
.
IsReadOnly
(
SvtSaveOptions
::
E_WARNALIENFORMAT
));
...
...
@@ -515,6 +536,8 @@ void SfxSaveTabPage::Reset( const SfxItemSet& )
aAutoSaveCB
.
SaveValue
();
aAutoSaveEdit
.
SaveValue
();
aUserAutoSaveCB
.
SaveValue
();
aRelativeFsysCB
.
SaveValue
();
aRelativeInetCB
.
SaveValue
();
aODFVersionLB
.
SaveValue
();
...
...
@@ -530,11 +553,13 @@ IMPL_LINK( SfxSaveTabPage, AutoClickHdl_Impl, CheckBox *, pBox )
{
aAutoSaveEdit
.
Enable
();
aMinuteFT
.
Enable
();
aUserAutoSaveCB
.
Enable
();
}
else
{
aAutoSaveEdit
.
Disable
();
aMinuteFT
.
Disable
();
aUserAutoSaveCB
.
Disable
();
}
}
return
0
;
...
...
cui/source/options/optsave.hrc
Dosyayı görüntüle @
89589859
...
...
@@ -29,6 +29,7 @@
#define BTN_AUTOSAVE 16
#define ED_AUTOSAVE 17
#define FT_MINUTE 18
#define BTN_USERAUTOSAVE 19
#define BTN_NOPRETTYPRINTING 20
#define FI_BACKUP 21
#define BTN_WARNALIENFORMAT 22
...
...
cui/source/options/optsave.hxx
Dosyayı görüntüle @
89589859
...
...
@@ -54,6 +54,7 @@ private:
CheckBox
aAutoSaveCB
;
NumericField
aAutoSaveEdit
;
FixedText
aMinuteFT
;
CheckBox
aUserAutoSaveCB
;
CheckBox
aRelativeFsysCB
;
CheckBox
aRelativeInetCB
;
...
...
cui/source/options/optsave.src
Dosyayı görüntüle @
89589859
...
...
@@ -110,36 +110,43 @@ TabPage RID_SFXPAGE_SAVE
Size = MAP_APPFONT ( 65 , 8 ) ;
Text [ en-US ] = "Minutes" ;
};
CheckBox BTN_USERAUTOSAVE
{
HelpID = "cui:CheckBox:RID_SFXPAGE_SAVE:BTN_USERAUTOSAVE"; //? FIX ME
Pos = MAP_APPFONT ( 21 , 74 ) ;
Size = MAP_APPFONT ( 163 , 10 ) ;
Text [ en-US ] = "Automatically save the document too" ;
};
CheckBox BTN_RELATIVE_FSYS
{
HelpID = "cui:CheckBox:RID_SFXPAGE_SAVE:BTN_RELATIVE_FSYS";
Pos = MAP_APPFONT ( 12 ,
74
) ;
Pos = MAP_APPFONT ( 12 ,
85
) ;
Size = MAP_APPFONT ( 236 , 10 ) ;
Text [ en-US ] = "Save URLs relative to file system" ;
};
CheckBox BTN_RELATIVE_INET
{
HelpID = "cui:CheckBox:RID_SFXPAGE_SAVE:BTN_RELATIVE_INET";
Pos = MAP_APPFONT ( 12 ,
85
) ;
Pos = MAP_APPFONT ( 12 ,
96
) ;
Size = MAP_APPFONT ( 248 , 10 ) ;
Text [ en-US ] = "Save URLs relative to internet" ;
};
FixedLine FL_FILTER
{
Pos = MAP_APPFONT ( 6 ,
97
) ;
Pos = MAP_APPFONT ( 6 ,
108
) ;
Size = MAP_APPFONT ( 248 , 8 ) ;
Text [ en-US ] = "Default file format and ODF settings" ;
};
FixedText FT_ODF_VERSION
{
Pos = MAP_APPFONT ( 12 , 1
07
) ;
Pos = MAP_APPFONT ( 12 , 1
18
) ;
Size = MAP_APPFONT ( 121 , 8 ) ;
Text [ en-US ] = "ODF format version" ;
};
ListBox LB_ODF_VERSION
{
HelpID = "cui:ListBox:RID_SFXPAGE_SAVE:LB_ODF_VERSION";
Pos = MAP_APPFONT ( 136 , 1
05
) ;
Pos = MAP_APPFONT ( 136 , 1
16
) ;
Size = MAP_APPFONT ( 108 , 58 ) ;
Border = TRUE;
DropDown = TRUE;
...
...
@@ -154,33 +161,33 @@ TabPage RID_SFXPAGE_SAVE
CheckBox BTN_NOPRETTYPRINTING
{
HelpID = "cui:CheckBox:RID_SFXPAGE_SAVE:BTN_NOPRETTYPRINTING";
Pos = MAP_APPFONT ( 12 , 1
20
) ;
Pos = MAP_APPFONT ( 12 , 1
31
) ;
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 , 1
31
) ;
Pos = MAP_APPFONT ( 12 , 1
42
) ;
Size = MAP_APPFONT ( 248 , 10 ) ;
Text [ en-US ] = "Warn when not saving in ODF or default format" ;
};
FixedText FT_APP
{
Pos = MAP_APPFONT ( 12 , 1
42
) ;
Pos = MAP_APPFONT ( 12 , 1
53
) ;
Size = MAP_APPFONT ( 120 , 8 ) ;
Text [ en-US ] = "D~ocument type";
};
FixedText FT_FILTER
{
Pos = MAP_APPFONT ( 136 , 1
42
) ;
Pos = MAP_APPFONT ( 136 , 1
53
) ;
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 , 1
53
) ;
Pos = MAP_APPFONT ( 12 , 1
64
) ;
Size = MAP_APPFONT ( 108 , 58 ) ;
Border = TRUE;
DropDown = TRUE;
...
...
@@ -197,14 +204,14 @@ TabPage RID_SFXPAGE_SAVE
};
FixedImage FI_FILTER
{
Pos = MAP_APPFONT ( 129, 1
54
) ;
Pos = MAP_APPFONT ( 129, 1
65
) ;
Size = MAP_APPFONT ( 6 , 6 ) ;
Hide = TRUE;
};
ListBox LB_FILTER
{
HelpID = "cui:ListBox:RID_SFXPAGE_SAVE:LB_FILTER";
Pos = MAP_APPFONT ( 136 , 1
53
) ;
Pos = MAP_APPFONT ( 136 , 1
64
) ;
Size = MAP_APPFONT ( 108 , 58 ) ;
Border = TRUE;
Sort = TRUE;
...
...
@@ -212,13 +219,13 @@ TabPage RID_SFXPAGE_SAVE
};
FixedImage FI_ODF_WARNING
{
Pos = MAP_APPFONT ( 12, 1
69
) ;
Pos = MAP_APPFONT ( 12, 1
70
) ;
Size = MAP_APPFONT ( 8 , 8 ) ;
Hide = TRUE;
};
FixedText FT_WARN
{
Pos = MAP_APPFONT ( 23 , 1
69
) ;
Pos = MAP_APPFONT ( 23 , 1
70
) ;
Size = MAP_APPFONT ( 239 , 8 ) ;
Hide = TRUE;
Text [ en-US ] = "Not using ODF 1.2 Extended may cause information to be lost.";
...
...
framework/inc/services/autorecovery.hxx
Dosyayı görüntüle @
89589859
...
...
@@ -213,7 +213,8 @@ class AutoRecovery : public css::lang::XTypeProvider
E_SESSION_RESTORE
=
128
,
E_DISABLE_AUTORECOVERY
=
256
,
E_SET_AUTOSAVE_STATE
=
512
,
E_SESSION_QUIET_QUIT
=
1024
E_SESSION_QUIET_QUIT
=
1024
,
E_USER_AUTO_SAVE
=
2048
};
//---------------------------------------
...
...
framework/source/services/autorecovery.cxx
Dosyayı görüntüle @
89589859
...
...
@@ -21,6 +21,8 @@
#include "services/autorecovery.hxx"
#include <loadenv/loadenv.hxx>
#include <sfx2/sfxbasemodel.hxx> //?
#include <loadenv/targethelper.hxx>
#include <pattern/frame.hxx>
#include <threadhelp/readguard.hxx>
...
...
@@ -124,6 +126,8 @@ static const char CFG_ENTRY_SESSIONDATA[] = "SessionData";
static
const
char
CFG_ENTRY_AUTOSAVE_ENABLED
[]
=
"AutoSave/Enabled"
;
static
const
char
CFG_ENTRY_AUTOSAVE_TIMEINTERVALL
[]
=
"AutoSave/TimeIntervall"
;
//sic!
static
const
char
CFG_ENTRY_USERAUTOSAVE_ENABLED
[]
=
"AutoSave/UserAutoSaveEnabled"
;
static
const
char
CFG_PATH_AUTOSAVE
[]
=
"AutoSave"
;
static
const
char
CFG_ENTRY_MINSPACE_DOCSAVE
[]
=
"MinSpaceDocSave"
;
static
const
char
CFG_ENTRY_MINSPACE_CONFIGSAVE
[]
=
"MinSpaceConfigSave"
;
...
...
@@ -977,12 +981,21 @@ void AutoRecovery::implts_readAutoSaveConfig()
sal_Bool
bEnabled
=
sal_False
;
xCommonRegistry
->
getByHierarchicalName
(
rtl
::
OUString
(
CFG_ENTRY_AUTOSAVE_ENABLED
))
>>=
bEnabled
;
// UserAutoSave [bool]
sal_Bool
bUserEnabled
=
sal_False
;
xCommonRegistry
->
getByHierarchicalName
(
rtl
::
OUString
(
CFG_ENTRY_USERAUTOSAVE_ENABLED
))
>>=
bUserEnabled
;
// SAFE -> ------------------------------
WriteGuard
aWriteLock
(
m_aLock
);
if
(
bEnabled
)
{
m_eJob
|=
AutoRecovery
::
E_AUTO_SAVE
;
m_eTimerType
=
AutoRecovery
::
E_NORMAL_AUTOSAVE_INTERVALL
;
if
(
bUserEnabled
)
m_eJob
|=
AutoRecovery
::
E_USER_AUTO_SAVE
;
else
m_eJob
&=
~
AutoRecovery
::
E_USER_AUTO_SAVE
;
}
else
{
...
...
@@ -2328,6 +2341,7 @@ void AutoRecovery::implts_saveOneDoc(const ::rtl::OUString&
// Mark AutoSave state as "INCOMPLETE" if it failed.
// Because the last temp file is to old and does not include all changes.
Reference
<
XDocumentRecovery
>
xDocRecover
(
rInfo
.
Document
,
css
::
uno
::
UNO_QUERY_THROW
);
Reference
<
XStorable
>
xDocSave
(
rInfo
.
Document
,
css
::
uno
::
UNO_QUERY_THROW
);
// safe the state about "trying to save"
// ... we need it for recovery if e.g. a crash occures inside next line!
...
...
@@ -2342,6 +2356,12 @@ void AutoRecovery::implts_saveOneDoc(const ::rtl::OUString&
{
xDocRecover
->
storeToRecoveryFile
(
rInfo
.
NewTempURL
,
lNewArgs
.
getAsConstPropertyValueList
()
);
// if userautosave is enabled, also save to the original file
if
((
m_eJob
&
AutoRecovery
::
E_USER_AUTO_SAVE
)
==
AutoRecovery
::
E_USER_AUTO_SAVE
)
{
xDocSave
->
store
();
}
#ifdef TRIGGER_FULL_DISC_CHECK
throw
css
::
uno
::
Exception
();
#else // TRIGGER_FULL_DISC_CHECK
...
...
officecfg/registry/data/org/openoffice/Office/Recovery.xcu
Dosyayı görüntüle @
89589859
...
...
@@ -25,6 +25,10 @@
<value
oor:external=
"com.sun.star.configuration.backend.GconfBackend AutoSaveEnabled"
/>
</prop>
<prop
oor:name=
"UserAutoSaveEnabled"
>
<value
oor:external=
"com.sun.star.configuration.backend.GconfBackend UserAutoSaveEnabled"
/>
</prop>
<prop
oor:name=
"TimeIntervall"
>
<value
oor:external=
"com.sun.star.configuration.backend.GconfBackend AutoSaveTimeIntervall"
/>
...
...
officecfg/registry/schema/org/openoffice/Office/Recovery.xcs
Dosyayı görüntüle @
89589859
...
...
@@ -131,6 +131,12 @@
</info>
<value>
true
</value>
</prop>
<prop
oor:name=
"UserAutoSaveEnabled"
oor:type=
"xs:boolean"
oor:nillable=
"false"
>
<info>
<desc>
</desc>
</info>
<value>
true
</value>
</prop>
<prop
oor:name=
"TimeIntervall"
oor:type=
"xs:int"
oor:nillable=
"false"
>
<info>
<desc>
</desc>
...
...
sfx2/inc/sfx2/sfxsids.hrc
Dosyayı görüntüle @
89589859
...
...
@@ -513,6 +513,7 @@
#define SID_ATTR_BACKUP (SID_OPTIONS_START + 1)
#define SID_ATTR_AUTOSAVE (SID_OPTIONS_START + 2)
#define SID_ATTR_AUTOSAVEPROMPT (SID_OPTIONS_START + 3)
#define SID_ATTR_USERAUTOSAVE (SID_OPTIONS_START + 4)
#define SID_ATTR_AUTOSAVEMINUTE (SID_OPTIONS_START + 5)
#define SID_ATTR_WORKINGSET (SID_OPTIONS_START + 13)
#define SID_ATTR_UNDO_COUNT (SID_OPTIONS_START + 16)
...
...
sfx2/source/appl/appcfg.cxx
Dosyayı görüntüle @
89589859
...
...
@@ -226,6 +226,14 @@ sal_Bool SfxApplication::GetOptions( SfxItemSet& rSet )
bRet
=
sal_False
;
}
break
;
case
SID_ATTR_USERAUTOSAVE
:
{
bRet
=
sal_True
;
if
(
!
aSaveOptions
.
IsReadOnly
(
SvtSaveOptions
::
E_USERAUTOSAVE
))
if
(
!
rSet
.
Put
(
SfxBoolItem
(
rPool
.
GetWhich
(
SID_ATTR_USERAUTOSAVE
),
aSaveOptions
.
IsUserAutoSave
())))
bRet
=
sal_False
;
}
break
;
case
SID_ATTR_DOCINFO
:
{
bRet
=
sal_True
;
...
...
@@ -582,6 +590,13 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
aSaveOptions
.
SetAutoSaveTime
(((
const
SfxUInt16Item
*
)
pItem
)
->
GetValue
());
}
// UserAutoSave
if
(
SFX_ITEM_SET
==
rSet
.
GetItemState
(
rPool
.
GetWhich
(
SID_ATTR_USERAUTOSAVE
),
sal_True
,
&
pItem
))
{
DBG_ASSERT
(
pItem
->
ISA
(
SfxBoolItem
),
"BoolItem expected"
);
aSaveOptions
.
SetUserAutoSave
(
(
(
const
SfxBoolItem
*
)
pItem
)
->
GetValue
()
);
}
// DocInfo
if
(
SFX_ITEM_SET
==
rSet
.
GetItemState
(
rPool
.
GetWhich
(
SID_ATTR_DOCINFO
),
sal_True
,
&
pItem
))
{
...
...
shell/source/backends/gconfbe/gconfaccess.cxx
Dosyayı görüntüle @
89589859
...
...
@@ -34,6 +34,7 @@
#define GCONF_PROXY_MODE_KEY "/system/proxy/mode"
#define GCONF_AUTO_SAVE_KEY "/apps/openoffice/auto_save"
#define GCONF_USER_AUTO_SAVE_KEY "/apps/openoffice/user_auto_save"
namespace
gconfaccess
{
...
...
@@ -425,6 +426,18 @@ sal_Bool SAL_CALL isDependencySatisfied( GConfClient* pClient, const Configurati
{
GConfValue
*
pGconfValue
=
gconf_client_get
(
pClient
,
GCONF_AUTO_SAVE_KEY
,
NULL
);
if
(
(
pGconfValue
!=
NULL
)
)
{
bool
bOk
=
gconf_value_get_bool
(
pGconfValue
);
gconf_value_free
(
pGconfValue
);
if
(
bOk
)
return
sal_True
;
}
}
break
;
case
SETTING_USER_AUTO_SAVE
:
{
GConfValue
*
pGconfValue
=
gconf_client_get
(
pClient
,
GCONF_USER_AUTO_SAVE_KEY
,
NULL
);
if
(
(
pGconfValue
!=
NULL
)
)
{
bool
bOk
=
gconf_value_get_bool
(
pGconfValue
);
...
...
@@ -598,6 +611,14 @@ ConfigurationValue const ConfigurationValues[] =
SETTINGS_LAST
},
{
SETTING_USER_AUTO_SAVE
,
GCONF_USER_AUTO_SAVE_KEY
,
RTL_CONSTASCII_STRINGPARAM
(
"UserAutoSaveEnabled"
),
sal_False
,
SETTINGS_LAST
},
{
SETTING_AUTO_SAVE_INTERVAL
,
"/apps/openoffice/auto_save_interval"
,
...
...
shell/source/backends/gconfbe/gconfaccess.hxx
Dosyayı görüntüle @
89589859
...
...
@@ -80,6 +80,7 @@ enum ConfigurationSetting
SETTING_CREATE_BACKUP
,
SETTING_WARN_ALIEN_FORMAT
,
SETTING_AUTO_SAVE
,
SETTING_USER_AUTO_SAVE
,
SETTING_AUTO_SAVE_INTERVAL
,
SETTING_WRITER_DEFAULT_DOC_FORMAT
,
SETTING_IMPRESS_DEFAULT_DOC_FORMAT
,
...
...
unotools/inc/unotools/saveopt.hxx
Dosyayı görüntüle @
89589859
...
...
@@ -47,7 +47,8 @@ public:
E_LOADDOCPRINTER
,
E_ODFDEFAULTVERSION
,
E_USESHA1INODF12
,
E_USEBLOWFISHINODF12
E_USEBLOWFISHINODF12
,
E_USERAUTOSAVE
,
};
// keep enum values sorted that a less or greater compare maps to older and newer versions!
...
...
@@ -81,6 +82,9 @@ public:
void
SetAutoSavePrompt
(
sal_Bool
b
);
sal_Bool
IsAutoSavePrompt
()
const
;
void
SetUserAutoSave
(
sal_Bool
b
);
sal_Bool
IsUserAutoSave
()
const
;
void
SetDocInfoSave
(
sal_Bool
b
);
sal_Bool
IsDocInfoSave
()
const
;
...
...
unotools/source/config/saveopt.cxx
Dosyayı görüntüle @
89589859
...
...
@@ -57,6 +57,7 @@ class SvtSaveOptions_Impl : public utl::ConfigItem
bBackup
,
bAutoSave
,
bAutoSavePrompt
,
bUserAutoSave
,
bDocInfSave
,
bSaveWorkingSet
,
bSaveDocView
,
...
...
@@ -76,6 +77,7 @@ class SvtSaveOptions_Impl : public utl::ConfigItem
bROBackup
,
bROAutoSave
,
bROAutoSavePrompt
,
bROUserAutoSave
,
bRODocInfSave
,
bROSaveWorkingSet
,
bROSaveDocView
,
...
...
@@ -101,6 +103,7 @@ public:
sal_Bool
IsBackup
()
const
{
return
bBackup
;
}
sal_Bool
IsAutoSave
()
const
{
return
bAutoSave
;
}
sal_Bool
IsAutoSavePrompt
()
const
{
return
bAutoSavePrompt
;
}
sal_Bool
IsUserAutoSave
()
const
{
return
bUserAutoSave
;
}
sal_Bool
IsDocInfoSave
()
const
{
return
bDocInfSave
;
}
sal_Bool
IsSaveWorkingSet
()
const
{
return
bSaveWorkingSet
;
}
sal_Bool
IsSaveDocView
()
const
{
return
bSaveDocView
;
}
...
...
@@ -121,6 +124,7 @@ public:
void
SetBackup
(
sal_Bool
b
);
void
SetAutoSave
(
sal_Bool
b
);
void
SetAutoSavePrompt
(
sal_Bool
b
);
void
SetUserAutoSave
(
sal_Bool
b
);
void
SetDocInfoSave
(
sal_Bool
b
);
void
SetSaveWorkingSet
(
sal_Bool
b
);
void
SetSaveDocView
(
sal_Bool
b
);
...
...
@@ -181,6 +185,16 @@ void SvtSaveOptions_Impl::SetAutoSavePrompt( sal_Bool b )
}
}
void
SvtSaveOptions_Impl
::
SetUserAutoSave
(
sal_Bool
b
)
{
if
(
!
bROUserAutoSave
&&
bUserAutoSave
!=
b
)
{
bUserAutoSave
=
b
;
SetModified
();
Commit
();
}
}
void
SvtSaveOptions_Impl
::
SetDocInfoSave
(
sal_Bool
b
)
{
if
(
!
bRODocInfSave
&&
bDocInfSave
!=
b
)
...
...
@@ -282,6 +296,9 @@ sal_Bool SvtSaveOptions_Impl::IsReadOnly( SvtSaveOptions::EOption eOption ) cons
case
SvtSaveOptions
:
:
E_AUTOSAVEPROMPT
:
bReadOnly
=
bROAutoSavePrompt
;
break
;
case
SvtSaveOptions
:
:
E_USERAUTOSAVE
:
bReadOnly
=
bROUserAutoSave
;
break
;
case
SvtSaveOptions
:
:
E_DOCINFSAVE
:
bReadOnly
=
bRODocInfSave
;
break
;
...
...
@@ -340,6 +357,7 @@ sal_Bool SvtSaveOptions_Impl::IsReadOnly( SvtSaveOptions::EOption eOption ) cons
#define ODFDEFAULTVERSION 15
#define USESHA1INODF12 16
#define USEBLOWFISHINODF12 17
#define USERAUTOSAVE 18
Sequence
<
OUString
>
GetPropertyNames
()
{
...
...
@@ -362,7 +380,8 @@ Sequence< OUString > GetPropertyNames()
"WorkingSet"
,
"ODF/DefaultVersion"
,
"ODF/UseSHA1InODF12"
,
"ODF/UseBlowfishInODF12"
"ODF/UseBlowfishInODF12"
,
"Document/UserAutoSave"
};
const
int
nCount
=
sizeof
(
aPropNames
)
/
sizeof
(
const
char
*
);
...
...
@@ -383,6 +402,7 @@ SvtSaveOptions_Impl::SvtSaveOptions_Impl()
,
bBackup
(
sal_False
)
,
bAutoSave
(
sal_False
)
,
bAutoSavePrompt
(
sal_False
)
,
bUserAutoSave
(
sal_False
)
,
bDocInfSave
(
sal_False
)
,
bSaveWorkingSet
(
sal_False
)
,
bSaveDocView
(
sal_False
)
...
...
@@ -400,6 +420,7 @@ SvtSaveOptions_Impl::SvtSaveOptions_Impl()
,
bROBackup
(
CFG_READONLY_DEFAULT
)
,
bROAutoSave
(
CFG_READONLY_DEFAULT
)
,
bROAutoSavePrompt
(
CFG_READONLY_DEFAULT
)
,
bROUserAutoSave
(
CFG_READONLY_DEFAULT
)
,
bRODocInfSave
(
CFG_READONLY_DEFAULT
)
,
bROSaveWorkingSet
(
CFG_READONLY_DEFAULT
)
,
bROSaveDocView
(
CFG_READONLY_DEFAULT
)
...
...
@@ -479,6 +500,10 @@ SvtSaveOptions_Impl::SvtSaveOptions_Impl()
bAutoSave
=
bTemp
;
bROAutoSave
=
pROStates
[
nProp
];
break
;
case
USERAUTOSAVE
:
bUserAutoSave
=
bTemp
;
bROUserAutoSave
=
pROStates
[
nProp
];
break
;
case
PROMPT
:
bAutoSavePrompt
=
bTemp
;
bROAutoSavePrompt
=
pROStates
[
nProp
];
...
...
@@ -563,6 +588,11 @@ SvtSaveOptions_Impl::SvtSaveOptions_Impl()
xCFG
,
::
rtl
::
OUString
(
"AutoSave"
),
::
rtl
::
OUString
(
"TimeIntervall"
))
>>=
nAutoSaveTime
;
::
comphelper
::
ConfigurationHelper
::
readRelativeKey
(
xCFG
,
::
rtl
::
OUString
(
"AutoSave"
),
::
rtl
::
OUString
(
"UserAutoSaveEnabled"
))
>>=
bUserAutoSave
;
}
catch
(
const
css
::
uno
::
Exception
&
)
{
OSL_FAIL
(
"Could not find needed information for AutoSave feature."
);
}
...
...
@@ -630,6 +660,14 @@ void SvtSaveOptions_Impl::Commit()
++
nRealCount
;
}
break
;
case
USERAUTOSAVE
:
if
(
!
bROUserAutoSave
)
{
pValues
[
nRealCount
]
<<=
bUserAutoSave
;
pNames
[
nRealCount
]
=
pOrgNames
[
i
];
++
nRealCount
;
}
break
;
case
EDITPROPERTY
:
if
(
!
bRODocInfSave
)
{
...
...
@@ -753,6 +791,12 @@ void SvtSaveOptions_Impl::Commit()
::
rtl
::
OUString
(
"Enabled"
),
css
::
uno
::
makeAny
(
bAutoSave
));
::
comphelper
::
ConfigurationHelper
::
writeRelativeKey
(
xCFG
,
::
rtl
::
OUString
(
"AutoSave"
),
::
rtl
::
OUString
(
"UserAutoSaveEnabled"
),
css
::
uno
::
makeAny
(
bUserAutoSave
));
::
comphelper
::
ConfigurationHelper
::
flush
(
xCFG
);
}
...
...
@@ -908,6 +952,16 @@ sal_Bool SvtSaveOptions::IsAutoSavePrompt() const
return
pImp
->
pSaveOpt
->
IsAutoSavePrompt
();
}
void
SvtSaveOptions
::
SetUserAutoSave
(
sal_Bool
b
)
{
pImp
->
pSaveOpt
->
SetUserAutoSave
(
b
);
}
sal_Bool
SvtSaveOptions
::
IsUserAutoSave
()
const
{
return
pImp
->
pSaveOpt
->
IsUserAutoSave
();
}
void
SvtSaveOptions
::
SetDocInfoSave
(
sal_Bool
b
)
{
pImp
->
pSaveOpt
->
SetDocInfoSave
(
b
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment