diff options
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/inc/sfx2/sfxsids.hrc | 1 | ||||
-rw-r--r-- | sfx2/sdi/sfx.sdi | 25 | ||||
-rw-r--r-- | sfx2/source/appl/app.src | 4 | ||||
-rw-r--r-- | sfx2/source/appl/shutdowniconOs2.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 66 |
5 files changed, 95 insertions, 3 deletions
diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc index e600c812a373..545464e09433 100644 --- a/sfx2/inc/sfx2/sfxsids.hrc +++ b/sfx2/inc/sfx2/sfxsids.hrc @@ -871,6 +871,7 @@ #define SID_HELP_PI (SID_SFX_START + 962) #define SID_BASIC_ENABLED (SID_SFX_START + 964) #define SID_EXPORT_DIALOG (SID_SFX_START + 965) +#define SID_IMPORT_DIALOG (SID_SFX_START + 966)
#define SID_BASICBREAK (SID_SFX_START +1521) diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index 32db454b17e5..db625a9386c3 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -5898,6 +5898,31 @@ SfxVoidItem ExportDialog SID_EXPORT_DIALOG ] //-------------------------------------------------------------------------- +SfxVoidItem ImportDialog SID_IMPORT_DIALOG
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
SfxVoidItem SaveConfiguration SID_SAVECONFIG (SfxStringItem FileName SID_CFGFILE) [ diff --git a/sfx2/source/appl/app.src b/sfx2/source/appl/app.src index 1337c74e7947..eacfefddc689 100644 --- a/sfx2/source/appl/app.src +++ b/sfx2/source/appl/app.src @@ -519,12 +519,12 @@ String STR_EVENT_CREATEDOC String STR_EVENT_CLOSEDOC { - Text [ en-US ] = "Document is closing" ; + Text [ en-US ] = "Document closed" ; }; String STR_EVENT_PREPARECLOSEDOC { - Text [ en-US ] = "Close Document" ; + Text [ en-US ] = "Document is closing" ; }; String STR_EVENT_OPENDOC diff --git a/sfx2/source/appl/shutdowniconOs2.cxx b/sfx2/source/appl/shutdowniconOs2.cxx index e527519d1564..6b69b5d0fae8 100644 --- a/sfx2/source/appl/shutdowniconOs2.cxx +++ b/sfx2/source/appl/shutdowniconOs2.cxx @@ -51,7 +51,7 @@ using namespace ::osl; // // This ObjectID must match the one created in WarpIN scripts!! // -#define QUICKSTART_OBJID "OO2B_QUICKSTART" +#define QUICKSTART_OBJID "OO2_QUICKSTART" bool ShutdownIcon::IsQuickstarterInstalled() { diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 89f2fe74e2f9..5a4aed274c30 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -136,6 +136,12 @@ #include "appbaslib.hxx" #include "appdata.hxx" +#ifdef OS2 +#include <osl/file.hxx> +#include <stdio.h> +#include <sys/ea.h> +#endif + #include "../appl/app.hrc" extern sal_uInt32 CheckPasswd_Impl( SfxObjectShell*, SfxItemPool&, SfxMedium* ); @@ -1784,6 +1790,66 @@ sal_Bool SfxObjectShell::SaveTo_Impl catch( Exception& ) { } + +#ifdef OS2 + { +#define CHAR_POINTER(THE_OUSTRING) ::rtl::OUStringToOString (THE_OUSTRING, RTL_TEXTENCODING_UTF8).pData->buffer + // Header for a single-valued ASCII EA data item + typedef struct _EA_ASCII_header { + USHORT usAttr; /* value: EAT_ASCII */ + USHORT usLen; /* length of data */ + CHAR szType[_MAX_PATH]; /* ASCII data fits in here ... */ + } EA_ASCII_HEADER; + char filePath[_MAX_PATH]; + char fileExt[_MAX_PATH]; + char docType[_MAX_PATH]; + int rc; + oslFileError eRet; + ::rtl::OUString aSystemFileURL; + const ::rtl::OUString aFileURL = rMedium.GetName(); + // close medium + rMedium.Close(); + + // convert file URL to system path + if (osl::FileBase::getSystemPathFromFileURL( aFileURL, aSystemFileURL) == osl::FileBase::E_None) { + EA_ASCII_HEADER eaAscii; + struct _ea eaType; + strcpy( filePath, CHAR_POINTER( aSystemFileURL)); + strcpy( docType, CHAR_POINTER( rMedium.GetFilter()->GetServiceName())); +#if OSL_DEBUG_LEVEL>1 + printf( "file name: %s\n", filePath); + printf( "filter name: %s\n", CHAR_POINTER(rMedium.GetFilter()->GetFilterName())); + printf( "service name: %s\n", docType); +#endif + // initialize OS/2 EA data structure + eaAscii.usAttr = EAT_ASCII; + _splitpath ( filePath, NULL, NULL, NULL, fileExt); + if (!stricmp( fileExt, ".pdf")) + strcpy( eaAscii.szType, "Acrobat Document"); + else if (!strcmp( docType, "com.sun.star.text.TextDocument")) + strcpy( eaAscii.szType, "OpenOfficeOrg Writer Document"); + else if (!strcmp( docType, "com.sun.star.sheet.SpreadsheetDocument")) + strcpy( eaAscii.szType, "OpenOfficeOrg Calc Document"); + else if (!strcmp( docType, "com.sun.star.presentation.PresentationDocument")) + strcpy( eaAscii.szType, "OpenOfficeOrg Impress Document"); + else if (!strcmp( docType, "com.sun.star.drawing.DrawingDocument")) + strcpy( eaAscii.szType, "OpenOfficeOrg Draw Document"); + else + strcpy( eaAscii.szType, "OpenOfficeOrg Document"); + eaAscii.usLen = strlen( eaAscii.szType); + // fill libc EA data structure + eaType.flags = 0; + eaType.size = sizeof(USHORT)*2 + eaAscii.usLen; + eaType.value = &eaAscii; + // put EA to file + rc = _ea_put( &eaType, filePath, 0, ".TYPE"); +#if OSL_DEBUG_LEVEL>1 + printf( "ea name: %s, rc %d, errno %d\n", eaAscii.szType, rc, errno); +#endif + } + } +#endif + } return bOk; |