summaryrefslogtreecommitdiff
path: root/sfx2/source/view/orgmgr.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/view/orgmgr.cxx')
-rwxr-xr-xsfx2/source/view/orgmgr.cxx263
1 files changed, 118 insertions, 145 deletions
diff --git a/sfx2/source/view/orgmgr.cxx b/sfx2/source/view/orgmgr.cxx
index 5979d64e1b7b..c923135dbdc4 100755
--- a/sfx2/source/view/orgmgr.cxx
+++ b/sfx2/source/view/orgmgr.cxx
@@ -57,23 +57,22 @@ using namespace ::com::sun::star;
//=========================================================================
-/* [Beschreibung]
-
- Implementierungsklasse; einzelner Eintrag in der Dateiansicht
+/* [Description]
+ Implementation class, single entry in the file view.
*/
struct _FileListEntry
{
- String aFileName; // Dateiname mit komplettem Pfad
- String aBaseName; // Dateiname
+ String aFileName; // File Name with complete path
+ String aBaseName; // File Name
const CollatorWrapper* pCollator;
- SfxObjectShellLock aDocShell; // ObjectShell als Ref-Klasse
+ SfxObjectShellLock aDocShell; // ObjectShell as reference class
- sal_Bool bFile; // als Datei auf Platte
- // (!= unbenannt1, nicht als Dok. geladen;
- // diese werden nicht gespeichert!)
- sal_Bool bOwner; // selbst erzeugt
+ sal_Bool bFile; // As File on disk
+ // (!= not processed, not loaded as document
+ // these are not saved!)
+ sal_Bool bOwner; // self-generated
sal_Bool bNoName;
sal_Bool bOwnFormat;
@@ -139,22 +138,21 @@ SV_IMPL_OP_PTRARR_SORT(_SfxObjectList, _FileListEntry*)
sal_Bool _FileListEntry::DeleteObjectShell()
-/* [Beschreibung]
-
- Freigabe der DokumentShell
+/* [Description]
- [Returnwert] sal_True: alles Ok
- sal_False: es ist ein Fehler aufgetreten (das
- Dokument konnte nicht gesichert werden)
+ Release of ther DocumentShell
+ [Return value] TRUE: Everything is ok
+ FALSE: An error occured
+ (the document could not be saved)
*/
{
sal_Bool bRet = sal_True;
- //Falls wir die Shell angelegt haben und sie veraendert wurde
+
if(bOwner && aDocShell.Is() && aDocShell->IsModified())
{
- //Mussten wir konvertieren?
+ // Converted?
if( bOwnFormat )
{
if(!aDocShell->Save() )
@@ -178,7 +176,7 @@ sal_Bool _FileListEntry::DeleteObjectShell()
}
else
{
- // Falls konvertiert im eigenen Format speichern
+ // If converted save in native format
INetURLObject aObj( aFileName );
String aTitle = aObj.getName( INetURLObject::LAST_SEGMENT, true,
INetURLObject::DECODE_WITH_CHARSET );
@@ -234,13 +232,9 @@ SfxOrganizeMgr::SfxOrganizeMgr( SfxOrganizeListBox_Impl *pLeft,
bDeleteTemplates(pTempl == 0),
bModified(0)
-/* [Beschreibung]
-
- Konstruktor
-
- Das aktuelle Dokument wird in die Liste der Dokumente
- aufgenommen.
+/* [Description]
+ Constructor. The current document is added to the list of documents.
*/
{
pImpl->pDocList = new SfxObjectList;
@@ -275,17 +269,17 @@ SfxOrganizeMgr::~SfxOrganizeMgr()
SfxObjectShellRef SfxOrganizeMgr::CreateObjectShell( sal_uInt16 nIdx )
-/* [Beschreibung]
+/* [Description]
- Zugriff auf die DokumentShell an der Position nIdx
+ Access to the DocumentShell at the position nIdx.
- [Returnwert] Referenz auf die DokumentShell
+ [Return value] Reference to the DocumentShell
*/
{
_FileListEntry* pEntry = (*pImpl->pDocList)[nIdx];
- // andernfalls Doc-Shell anlegen
+ // otherwise create Doc-Shell
if ( !pEntry->aDocShell.Is() )
{
INetURLObject aFileObj( pEntry->aFileName );
@@ -336,14 +330,13 @@ SfxObjectShellRef SfxOrganizeMgr::CreateObjectShell( sal_uInt16 nIdx )
sal_Bool SfxOrganizeMgr::DeleteObjectShell(sal_uInt16 nIdx)
-/* [Beschreibung]
+/* [Description]
- Freigabe der DokumentShell an der Position nIdx
-
- [Returnwert] sal_True: alles Ok
- sal_False: es ist ein Fehler aufgetreten (das
- Dokument konnte nicht gesichert werden)
+ Release DocumentShell at position nIdx
+ [Return value] TRUE: Everything is ok
+ FALSE: An error occured
+ (the document could not be saved)
*/
{
return (*pImpl->pDocList)[nIdx]->DeleteObjectShell();
@@ -353,12 +346,12 @@ sal_Bool SfxOrganizeMgr::DeleteObjectShell(sal_uInt16 nIdx)
SfxObjectShellRef SfxOrganizeMgr::CreateObjectShell(sal_uInt16 nRegion,
sal_uInt16 nIdx)
-/* [Beschreibung]
+/* [Description]
- Zugriff auf die DokumentShell an der Position nIdx im Bereich
- nRegion (Dokumentvorlage)
+ Access to the DocumentShell at Position nIdx in Region
+ nRegion (Document template)
- [Returnwert] Referenz auf die DokumentShell
+ [Return value] Reference to the DocumentShell
*/
{
@@ -369,15 +362,14 @@ SfxObjectShellRef SfxOrganizeMgr::CreateObjectShell(sal_uInt16 nRegion,
sal_Bool SfxOrganizeMgr::DeleteObjectShell(sal_uInt16 nRegion, sal_uInt16 nIdx)
-/* [Beschreibung]
-
- Freigabe der DokumentShell an der Position nIdx im Bereich
- nRegion (Dokumentvorlage)
+/* [Description]
- [Returnwert] sal_True: alles Ok
- sal_False: es ist ein Fehler aufgetreten (das
- Dokument konnte nicht gesichert werden)
+ Release of the DocumentShell at Position nIdx in Region
+ nRegion (Document template)
+ [Return value] TRUE: Everything is ok
+ FALSE: An error occured
+ (the document could not be saved)
*/
{
@@ -391,22 +383,22 @@ sal_Bool SfxOrganizeMgr::Copy(sal_uInt16 nTargetRegion,
sal_uInt16 nSourceRegion,
sal_uInt16 nSourceIdx)
-/* [Beschreibung]
+/* [Description]
- Kopieren einer Dokumentvorlage
+ Copy of a Document Template
[Parameter]
- sal_uInt16 nTargetRegion Index des Zielbereiches
- sal_uInt16 nTargetIdx Index Zielposition
- sal_uInt16 nSourceRegion Index des Quellbereiches
- sal_uInt16 nSourceIdx Index der zu kopierenden / z uverschiebenden
- Dokumentvorlage
+ sal_uInt16 nTargetRegion Index of the Target Region
+ sal_uInt16 nTargetIdx Index of the Target Position
+ sal_uInt16 nSourceRegion Index of the Source Region
+ sal_uInt16 nSourceIdx Index of the template to be
+ copied/moved.
- [R"uckgabewert] Erfolg (TRUE) oder Mi"serfolg (FALSE)
+ [Return value] Success (TRUE) or Failure (FALSE)
- [Querverweise]
+ [Cross-reference]
<SfxDocumentTemplates::Copy(sal_uInt16 nTargetRegion,
sal_uInt16 nTargetIdx,
@@ -416,7 +408,7 @@ sal_Bool SfxOrganizeMgr::Copy(sal_uInt16 nTargetRegion,
*/
{
- if(nSourceIdx == USHRT_MAX) // keine Verzeichnisse kopieren
+ if(nSourceIdx == USHRT_MAX) // No directories copied
return sal_False ;
const sal_Bool bOk = pTemplates->Copy(nTargetRegion, nTargetIdx,
nSourceRegion, nSourceIdx);
@@ -432,32 +424,30 @@ sal_Bool SfxOrganizeMgr::Move(sal_uInt16 nTargetRegion,
sal_uInt16 nSourceRegion,
sal_uInt16 nSourceIdx)
-/* [Beschreibung]
+/* [Description]
- Verschieben einer Dokumentvorlage
+ Moving a template
[Parameter]
- sal_uInt16 nTargetRegion Index des Zielbereiches
- sal_uInt16 nTargetIdx Index Zielposition
- sal_uInt16 nSourceRegion Index des Quellbereiches
- sal_uInt16 nSourceIdx Index der zu kopierenden / z uverschiebenden
- Dokumentvorlage
-
- [R"uckgabewert] Erfolg (TRUE) oder Mi"serfolg (FALSE)
+ sal_uInt16 nTargetRegion Index of the Target Region
+ sal_uInt16 nTargetIdx Index of the Target Position
+ sal_uInt16 nSourceRegion Index of the Source Region
+ sal_uInt16 nSourceIdx Index of the template to be
+ copied/moved.
+ [Return value] Success (TRUE) or Failure (FALSE)
- [Querverweise]
+ [Cross-reference]
<SfxDocumentTemplates::Move(sal_uInt16 nTargetRegion,
sal_uInt16 nTargetIdx,
sal_uInt16 nSourceRegion,
sal_uInt16 nSourceIdx)>
-
*/
{
- if(nSourceIdx == USHRT_MAX) // keine Verzeichnisse verschieben
+ if(nSourceIdx == USHRT_MAX) // No directory moved
return sal_False ;
const sal_Bool bOk = pTemplates->Move(nTargetRegion, nTargetIdx,
nSourceRegion, nSourceIdx);
@@ -471,24 +461,21 @@ sal_Bool SfxOrganizeMgr::Move(sal_uInt16 nTargetRegion,
sal_Bool SfxOrganizeMgr::Delete(SfxOrganizeListBox_Impl *pCaller,
sal_uInt16 nRegion, sal_uInt16 nIdx)
-/* [Beschreibung]
+/* [Description]
- "oschen einer Dokumentvorlage
+ Delete a Document Template
[Parameter]
- SfxOrganizeListBox *pCaller rufende ListBox; da dieses
- Event durch das Men"u oder
- durch das Keyboard angetriggert wird,
- mu"s das Model der ListBox anschlie"send
- aktualisiert werden.
- sal_uInt16 nRegion Index des Bereiches
- sal_uInt16 nIdx Index der Dokumentvorlage
-
- [R"uckgabewert] Erfolg (TRUE) oder Mi"serfolg (FALSE)
+ SfxOrganizeListBox *pCaller calling ListBox, since this event
+ is triggered by the menu or the
+ keyboard, the ListBox must be updated.
+ sal_uInt16 nRegion Index for Region
+ sal_uInt16 nIdx Index of Document template
+ [Return value] Success (TRUE) or Failure (FALSE)
- [Querverweise]
+ [Cross-reference]
<SfxDocumentTemplates::Delete(sal_uInt16 nRegion, sal_uInt16 nIdx)>
@@ -541,7 +528,7 @@ sal_Bool SfxOrganizeMgr::Delete(SfxOrganizeListBox_Impl *pCaller,
if(bOk)
{
bModified = 1;
- // zu loeschender Eintrag
+ // Entry to be deleted.
SvLBoxEntry *pEntryToDelete = pCaller->SvLBox::GetEntry(pCaller->SvLBox::GetEntry(nRegion), nIdx);
pCaller->GetModel()->Remove(pEntryToDelete);
@@ -555,26 +542,20 @@ sal_Bool SfxOrganizeMgr::Delete(SfxOrganizeListBox_Impl *pCaller,
sal_Bool SfxOrganizeMgr::InsertDir
(
- SfxOrganizeListBox_Impl* pCaller,/* rufende ListBox; da dieses Event
- durch das Men"u oder durch das
- Keyboard angetriggert wird,
- mu\s das Model der ListBox
- anschlie\send aktualisiert werden */
- const String& rText, // logischer Name des Bereiches
- sal_uInt16 nRegion // Index des Bereiches
+ SfxOrganizeListBox_Impl* pCaller, /* calling ListBox, since this event
+ is triggered by the menu or the
+ keyboard, the ListBox must be updated. */
+ const String& rText, // logical Name of Region
+ sal_uInt16 nRegion // Index of Region
)
-/* [Beschreibung]
+/* [Description]
- Einf"ugen eines Bereiches
+ Insert Region.
+ [Return value] Success (TRUE) or Failure (FALSE)
- [R"uckgabewert]
-
- Erfolg (sal_True) oder Mi\serfolg (sal_False)
-
-
- [Querverweise]
+ [Cross-reference]
<SfxDocumentTemplates::InsertDir(const String &, sal_uInt16 nRegion)>
*/
@@ -599,23 +580,21 @@ sal_Bool SfxOrganizeMgr::InsertDir
sal_Bool SfxOrganizeMgr::SetName(const String &rName,
sal_uInt16 nRegion, sal_uInt16 nIdx)
-/* [Beschreibung]
+/* [Description]
- "Andern eines (logischen) Namens
+ Set (logical) Name
[Parameter]
- const String &rName der neue Name
- sal_uInt16 nRegion Index des Bereiches
- sal_uInt16 nIdx Index der Dokumentvorlage
+ const String &rName The new Name
+ sal_uInt16 nRegion Index of Region
+ sal_uInt16 nIdx Index of Document template
- [R"uckgabewert] Erfolg (TRUE) oder Mi"serfolg (FALSE)
+ [Return value] Success (TRUE) or Failure (FALSE)
-
- [Querverweise]
+ [Cross-reference]
<SfxDocumentTemplates::SetName(const String &, sal_uInt16 nRegion, sal_uInt16 nIdx)>
-
*/
{
@@ -629,23 +608,21 @@ sal_Bool SfxOrganizeMgr::SetName(const String &rName,
sal_Bool SfxOrganizeMgr::CopyTo(sal_uInt16 nRegion, sal_uInt16 nIdx, const String &rName) const
-/* [Beschreibung]
+/* [Description]
- Export einer Vorlage
+ Export of a Template
[Parameter]
- sal_uInt16 nRegion Index des Bereiches
- sal_uInt16 nIdx Index der Dokumentvorlage
- const String &rName Dateiname
+ sal_uInt16 nRegion Index of Region
+ sal_uInt16 nIdx Index of Document Template
+ const String &rName File name
- [R"uckgabewert] Erfolg (TRUE) oder Mi"serfolg (FALSE)
+ [Return value] Success (TRUE) or Failure (FALSE)
-
- [Querverweise]
+ [Cross-reference]
<SfxDocumentTemplates::CopyTo( sal_uInt16 nRegion, sal_uInt16 nIdx, const String &)>
-
*/
{
@@ -657,27 +634,25 @@ sal_Bool SfxOrganizeMgr::CopyTo(sal_uInt16 nRegion, sal_uInt16 nIdx, const Strin
sal_Bool SfxOrganizeMgr::CopyFrom(SfxOrganizeListBox_Impl *pCaller,
sal_uInt16 nRegion, sal_uInt16 nIdx, String &rName)
-/* [Beschreibung]
+/* [Description]
- Import einer Vorlage
+ Import of Document Template
[Parameter]
- SfxOrganizeListBox *pCaller rufende ListBox; da dieses
- Event durch das Men"u angetriggert wird,
- mu"s das Model der ListBox anschlie"send
- aktualisiert werden.
- sal_uInt16 nRegion Index des Bereiches
- sal_uInt16 nIdx Index der Dokumentvorlage
- String &rName Dateiname
+ SfxOrganizeListBox *pCaller calling ListBox, since this event
+ is triggered by the menu or the
+ keyboard, the ListBox must be updated.
- [R"uckgabewert] Erfolg (TRUE) oder Mi"serfolg (FALSE)
+ sal_uInt16 nRegion Index of Region
+ sal_uInt16 nIdx Index of Document Template
+ String &rName File name
+ [Return value] Success (TRUE) or Failure (FALSE)
- [Querverweise]
+ [Cross-reference]
<SfxDocumentTemplates::CopyFrom( sal_uInt16 nRegion, sal_uInt16 nIdx, const String &)>
-
*/
{
@@ -686,7 +661,7 @@ sal_Bool SfxOrganizeMgr::CopyFrom(SfxOrganizeListBox_Impl *pCaller,
pParent = pCaller->GetParent(pParent);
if( pTemplates->CopyFrom( nRegion, nIdx, rName ) )
{
- // pCaller aktualisieren
+ // Update pCaller
if( nIdx == USHRT_MAX )
nIdx = 0;
else nIdx++;
@@ -710,20 +685,19 @@ sal_Bool SfxOrganizeMgr::CopyFrom(SfxOrganizeListBox_Impl *pCaller,
sal_Bool SfxOrganizeMgr::InsertFile( SfxOrganizeListBox_Impl* pCaller, const String& rFileName )
-/* [Beschreibung]
+/* [Description]
- Eine Datei in der Dateiansicht hinzuf"ugen
+ Insert a file in the file view.
[Parameter]
- SfxOrganizeListBox *pCaller rufende ListBox; da dieses
- Event durch das Men"u angetriggert wird,
- mu"s das Model der ListBox anschlie"send
- aktualisiert werden.
- const String &rFileName Name der hinzuf"ugenden Datei
+ SfxOrganizeListBox *pCaller calling ListBox, since this event
+ is triggered by the menu or the
+ keyboard, the ListBox must be updated.
- [R"uckgabewert] Erfolg (TRUE) oder Mi"serfolg (FALSE)
+ const String &rFileName Name of inserted File.
+ [Return value] Success (TRUE) or Failure (FALSE)
*/
{
@@ -744,16 +718,16 @@ sal_Bool SfxOrganizeMgr::InsertFile( SfxOrganizeListBox_Impl* pCaller, const Str
sal_Bool SfxOrganizeMgr::Rescan()
-/* [Beschreibung]
+/* [Description]
- Aktualisieren der Datenbasis
+ Updating the database.
- [R"uckgabewert]
+ [Return value]
- sal_True es bestanden Unterschiede
- FALSE keine "Anderung
+ TRUE Changes were made
+ FALSE No changes
- [Querverweise]
+ [Cross-reference]
<SfxDocumentTemplates::Rescan()>
*/
@@ -771,14 +745,13 @@ sal_Bool SfxOrganizeMgr::Rescan()
void SfxOrganizeMgr::SaveAll(Window *pParent)
-/* [Beschreibung]
+/* [Description]
- Schreiben aller ge"anderten Dokumente
+ Save all Documents that have been modified
[Parameter]
- Window *pParent Parent der Boxen f"ur Fehlermeldungen
-
+ Window *pParent Parent of the Error message Box
*/
{