diff options
author | Mathias Bauer <mba@openoffice.org> | 2010-10-28 23:02:10 +0200 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2010-10-28 23:02:10 +0200 |
commit | e775b40a11ca0eab7964dacc8387367086e2b029 (patch) | |
tree | 6ef64962794427131bea51ffc182b11a394bcc59 /svtools | |
parent | acbb009ba0992ec4ad4c9848c0b0ac9ee81effa4 (diff) | |
parent | d5d2a1cffc728100f8119252ff26f95949e6d35c (diff) |
CWS gnumake: resync to m91; conflicts unresolved
Diffstat (limited to 'svtools')
109 files changed, 3346 insertions, 3062 deletions
diff --git a/svtools/bmpmaker/bmp.src b/svtools/bmpmaker/bmp.src index 7431d2e335a4..30ff9488a805 100644 --- a/svtools/bmpmaker/bmp.src +++ b/svtools/bmpmaker/bmp.src @@ -27,6 +27,7 @@ #include "bmp.hrc" ModalDialog DLG_PATH { + HelpID = "svtools:ModalDialog:DLG_PATH"; OutputSize = TRUE; SVLook = TRUE; Size = MAP_APPFONT( 301, 104 ); @@ -54,36 +55,42 @@ ModalDialog DLG_PATH { Text = "Bitmap-Pfad:"; }; Edit EDT_SRS { + HelpID = "svtools:Edit:DLG_PATH:EDT_SRS"; Border = TRUE; Pos = MAP_APPFONT( 65, 14 ); Size = MAP_APPFONT( 160, 12 ); TabStop = TRUE; }; Edit EDT_RES { + HelpID = "svtools:Edit:DLG_PATH:EDT_RES"; Border = TRUE; Pos = MAP_APPFONT( 65, 29 ); Size = MAP_APPFONT( 160, 12 ); TabStop = TRUE; }; Edit EDT_OUT { + HelpID = "svtools:Edit:DLG_PATH:EDT_OUT"; Border = TRUE; Pos = MAP_APPFONT( 65, 44 ); Size = MAP_APPFONT( 160, 12 ); TabStop = TRUE; }; PushButton BTN_SRS { + HelpID = "svtools:PushButton:DLG_PATH:BTN_SRS"; Pos = MAP_APPFONT( 228, 14 ); Size = MAP_APPFONT( 15, 12 ); Text = "..."; TabStop = TRUE; }; PushButton BTN_RES { + HelpID = "svtools:PushButton:DLG_PATH:BTN_RES"; Pos = MAP_APPFONT( 228, 29 ); Size = MAP_APPFONT( 15, 12 ); Text = "..."; TabStop = TRUE; }; PushButton BTN_OUT { + HelpID = "svtools:PushButton:DLG_PATH:BTN_OUT"; Pos = MAP_APPFONT( 228, 44 ); Size = MAP_APPFONT( 15, 12 ); Text = "..."; @@ -106,6 +113,7 @@ ModalDialog DLG_PATH { Text = "Sprache"; }; ListBox LB_LANG { + HelpID = "svtools:ListBox:DLG_PATH:LB_LANG"; Border = TRUE; Pos = MAP_APPFONT( 12, 76 ); Size = MAP_APPFONT( 231, 70 ); diff --git a/svtools/inc/svtools/fileview.hxx b/svtools/inc/svtools/fileview.hxx index 74476541dcd8..db704a0e6784 100644 --- a/svtools/inc/svtools/fileview.hxx +++ b/svtools/inc/svtools/fileview.hxx @@ -104,8 +104,8 @@ public: sal_Bool GetParentURL( String& _rParentURL ) const; sal_Bool CreateNewFolder( const String& rNewFolder ); - void SetHelpId( sal_uInt32 nHelpId ); - sal_uInt32 GetHelpId( ) const; + void SetHelpId( const rtl::OString& rHelpId ); + const rtl::OString& GetHelpId( ) const; void SetSizePixel( const Size& rNewSize ); using Window::SetPosSizePixel; virtual void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize ); diff --git a/svtools/inc/svtools/filter.hxx b/svtools/inc/svtools/filter.hxx index 49ec77adfea5..8c6f014d4219 100644 --- a/svtools/inc/svtools/filter.hxx +++ b/svtools/inc/svtools/filter.hxx @@ -134,16 +134,6 @@ class Graphic; #define GFF_EMF ( (USHORT)0x00f8 ) #define GFF_XXX ( (USHORT)0xffff ) -// --------------- -// - RequestInfo - -// --------------- - -struct RequestInfo -{ - BYTE* pBuffer; - ULONG nRealBufferSize; -}; - // --------------------- // - GraphicDescriptor - // --------------------- @@ -151,29 +141,18 @@ struct RequestInfo class SVT_DLLPUBLIC GraphicDescriptor { SvStream* pFileStm; - Link aReqLink; + String aPathExt; Size aPixSize; Size aLogSize; - SvStream* pMemStm; - SvStream* pBaseStm; - ULONG nStmPos; USHORT nBitsPerPixel; USHORT nPlanes; USHORT nFormat; BOOL bCompressed; - BOOL bDataReady; - BOOL bLinked; - BOOL bLinkChanged; - BOOL bWideSearch; - BOOL bBaseStm; - long nExtra1; - long nExtra2; + BOOL bOwnStream; void ImpConstruct(); -//#if 0 // _SOLAR__PRIVATE - BOOL ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo ); BOOL ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo ); BOOL ImpDetectJPG( SvStream& rStm, BOOL bExtendedInfo ); @@ -199,27 +178,11 @@ class SVT_DLLPUBLIC GraphicDescriptor BOOL ImpDetectSGV( SvStream& rStm, BOOL bExtendedInfo ); BOOL ImpDetectEMF( SvStream& rStm, BOOL bExtendedInfo ); -//#endif - GraphicDescriptor( const GraphicDescriptor& ); GraphicDescriptor& operator=( const GraphicDescriptor& ); -protected: - - BOOL IsDataReady() const; - BOOL IsWideSearch() const; - SvStream& GetSearchStream() const; - const String& GetPathExtension() const; - public: - // Default-Ctor, um anschliessend einen Link zu setzen, mit dem - // die Daten vom Aufrufer im ::Detect() angefordert werden. - // da einige Formate ( Mtf's ) keinen eindeutigen Header besitzen, - // ist es sinnvoll den vollen Filenamen (inkl. Ext. ) mitanzugeben, - // da so das Format ueber die Extension ermittelt werden kann - GraphicDescriptor( const String* pPath = NULL ); - // Ctor, um einen Filenamen zu setzen. Es muss ::Detect() gerufen werden, // um das File zu identifizieren; // wenn das File keinen eindeutigen Header besitzt ( Mtf's ) wird das @@ -261,21 +224,6 @@ public: // zeigt an, ob das Bild evtl. komprimiert (wie auch immer) ist BOOL IsCompressed() const { return bCompressed; } - // setzt den LinkHdl zum Setzen der Bytes; - // der Handler muss einen Pointer auf die RequestInfo-Struktur - // zurueckgeben; die Anzahl der minimal zur Verfuegung zu stellenden - // Daten muss im Handler ueber ::GetRequestedByteCount() erfragt werden; - // die tatsaechlich zur Verfuegung gestellte BYTE-Anzahl - // wird in der RequestInfo-Struktur gesetzt - void SetRequestHdl( const Link& rRequestHdl ); - - // gibt den LinkHdl zum Setzen der Bytes zurueck - const Link& GetRequestHdl() const { return aReqLink; } - - // muss im ReqHdl gerufen werden, um zu erfahren, wieviele - // Bytes _mindestens_ bereitgestellt werden muessen - ULONG GetRequestedByteCount() const; - // gibt die Filternummer des Filters zurueck, // der im GraphicFilter zum Lesen dieses Formats // benoetigt wird diff --git a/svtools/inc/svtools/fltdefs.hxx b/svtools/inc/svtools/fltdefs.hxx index 8ef3f2ab3740..86462c2faa33 100644 --- a/svtools/inc/svtools/fltdefs.hxx +++ b/svtools/inc/svtools/fltdefs.hxx @@ -34,7 +34,7 @@ #define _FLTDEFS_HXX -#if defined ( WIN ) || defined ( WNT ) +#if defined ( WNT ) #define RGBQUAD RGBQUADWIN @@ -53,21 +53,6 @@ typedef struct RGBQUAD } RGBQUAD; -#ifdef WIN -typedef BYTE huge* PDIBBYTE; -#define MEMCPY hmemcpy -#define GLOBALALLOC(nSize) ((PDIBBYTE)GlobalLock(GlobalAlloc(GHND,(nSize)))) -#define GLOBALHANDLE(pPointer) ((HGLOBAL)GlobalHandle((*((size_t*)&(pPointer)+1)))) -#define GLOBALFREE(pPointer) (GlobalUnlock(GLOBALHANDLE((pPointer)))) -#define MEMSET( pDst, cByte, nCount ) \ -{ \ - PDIBBYTE pTmp = (PDIBBYTE) pDst; \ - for ( ULONG i = 0; i < nCount; i++ )\ - *pTmp++ = cByte; \ -} - -#else - typedef BYTE* PDIBBYTE; #define MEMCPY memcpy #define MEMSET memset @@ -75,7 +60,6 @@ typedef BYTE* PDIBBYTE; #define GLOBALFREE(pPointer) (GlobalFree((HGLOBAL)pPointer)) #define GLOBALHANDLE(pPointer) ((HGLOBAL)(pPointer)) -#endif #else typedef BYTE* PDIBBYTE; diff --git a/svtools/inc/svtools/headbar.hxx b/svtools/inc/svtools/headbar.hxx index 1ef7687cfb1d..c225a95d1f55 100644 --- a/svtools/inc/svtools/headbar.hxx +++ b/svtools/inc/svtools/headbar.hxx @@ -360,15 +360,15 @@ public: void SetHelpText( USHORT nItemId, const XubString& rText ); XubString GetHelpText( USHORT nItemId ) const; - void SetHelpId( USHORT nItemId, ULONG nHelpId ); - ULONG GetHelpId( USHORT nItemId ) const; + void SetHelpId( USHORT nItemId, const rtl::OString& nHelpId ); + rtl::OString GetHelpId( USHORT nItemId ) const; Size CalcWindowSizePixel() const; inline void SetHelpText( const String& rText ) { Window::SetHelpText( rText ); } inline const String& GetHelpText() const { return Window::GetHelpText(); } - inline void SetHelpId( ULONG nId ) { Window::SetHelpId( nId ); } - inline ULONG GetHelpId() const { return Window::GetHelpId(); } + inline void SetHelpId( const rtl::OString& rId ) { Window::SetHelpId( rId ); } + inline const rtl::OString& GetHelpId() const { return Window::GetHelpId(); } inline void SetStartDragHdl( const Link& rLink ) { maStartDragHdl = rLink; } inline const Link& GetStartDragHdl() const { return maStartDragHdl; } diff --git a/svtools/inc/svtools/helpid.hrc b/svtools/inc/svtools/helpid.hrc index 1ffb7a99fb32..ecf8ba4b1bf7 100644 --- a/svtools/inc/svtools/helpid.hrc +++ b/svtools/inc/svtools/helpid.hrc @@ -28,90 +28,103 @@ #ifndef _SVT_HELPID_HRC #define _SVT_HELPID_HRC -// include --------------------------------------------------------------- - -#include <svl/solar.hrc> - -// Help-Ids -------------------------------------------------------------- - -#define HID_FILEDLG_OPENDLG (HID_SVTOOLS_START + 0) -#define HID_FILEDLG_PATHDLG (HID_SVTOOLS_START + 1) -#define HID_FILEDLG_DIR (HID_SVTOOLS_START + 2) -#define HID_FILEDLG_EDIT (HID_SVTOOLS_START + 3) -#define HID_FILEDLG_DIRS (HID_SVTOOLS_START + 4) -#define HID_FILEDLG_DRIVE (HID_SVTOOLS_START + 5) -#define HID_FILEDLG_DRIVES (HID_SVTOOLS_START + 6) -#define HID_FILEDLG_NEWDIR (HID_SVTOOLS_START + 7) -#define HID_FILEDLG_HOME (HID_SVTOOLS_START + 8) -#define HID_FILEDLG_FILE (HID_SVTOOLS_START + 9) -#define HID_FILEDLG_FILES (HID_SVTOOLS_START + 10) -#define HID_FILEDLG_PATH (HID_SVTOOLS_START + 11) -#define HID_FILEDLG_TYPE (HID_SVTOOLS_START + 12) -#define HID_FILEDLG_TYPES (HID_SVTOOLS_START + 13) +#define HID_FILEDLG_OPENDLG "SVT_HID_FILEDLG_OPENDLG" +#define HID_FILEDLG_PATHDLG "SVT_HID_FILEDLG_PATHDLG" +#define HID_FILEDLG_DIR "SVT_HID_FILEDLG_DIR" +#define HID_FILEDLG_EDIT "SVT_HID_FILEDLG_EDIT" +#define HID_FILEDLG_DIRS "SVT_HID_FILEDLG_DIRS" +#define HID_FILEDLG_DRIVE "SVT_HID_FILEDLG_DRIVE" +#define HID_FILEDLG_DRIVES "SVT_HID_FILEDLG_DRIVES" +#define HID_FILEDLG_NEWDIR "SVT_HID_FILEDLG_NEWDIR" +#define HID_FILEDLG_HOME "SVT_HID_FILEDLG_HOME" +#define HID_FILEDLG_FILE "SVT_HID_FILEDLG_FILE" +#define HID_FILEDLG_FILES "SVT_HID_FILEDLG_FILES" +#define HID_FILEDLG_PATH "SVT_HID_FILEDLG_PATH" +#define HID_FILEDLG_TYPE "SVT_HID_FILEDLG_TYPE" +#define HID_FILEDLG_TYPES "SVT_HID_FILEDLG_TYPES" +#define HID_FILEDLG_LINK_CB "SVT_HID_FILEDLG_LINK_CB" +#define HID_FILEDLG_PREVIEW_CB "SVT_HID_FILEDLG_PREVIEW_CB" +#define HID_FILEDLG_STANDARD "SVT_HID_FILEDLG_STANDARD" +#define HID_FILEDLG_MANAGER "SVT_HID_FILEDLG_MANAGER" +#define HID_FILEDLG_URL "SVT_HID_FILEDLG_URL" +#define HID_FILEDLG_USE_PASSWD "SVT_HID_FILEDLG_USE_PASSWD" +#define HID_FILEDLG_READ_ONLY "SVT_HID_FILEDLG_READ_ONLY" +#define HID_FILEDLG_AUTOCOMPLETEBOX "SVT_HID_FILEDLG_AUTOCOMPLETEBOX" +#define HID_FILEDLG_SAVE_BTN "SVT_HID_FILEDLG_SAVE_BTN" +#define HID_FILEDLG_SAVE_FILENAME "SVT_HID_FILEDLG_SAVE_FILENAME" +#define HID_FILEDLG_SAVE_FILETYPE "SVT_HID_FILEDLG_SAVE_FILETYPE" +#define HID_FILEDLG_INSERT_BTN "SVT_HID_FILEDLG_INSERT_BTN" +#define HID_FILEDLG_PATH_BTN "SVT_HID_FILEDLG_PATH_BTN" +#define HID_FILEDLG_PATH_FILENAME "SVT_HID_FILEDLG_PATH_FILENAME" +#define HID_FILEDLG_FOLDER_BTN "SVT_HID_FILEDLG_FOLDER_BTN" +#define HID_FILEDLG_FOLDER_FILENAME "SVT_HID_FILEDLG_FOLDER_FILENAME" +#define HID_FILEDLG_SRCHFOLDER_BTN "SVT_HID_FILEDLG_SRCHFOLDER_BTN" +#define HID_FILEDLG_EDIT_FAVORITES "SVT_HID_FILEDLG_EDIT_FAVORITES" +#define HID_FILEDLG_NEW_FAVORITE "SVT_HID_FILEDLG_NEW_FAVORITE" +#define HID_FILEDLG_EDIT_FAVORITES_LISTBOX "SVT_HID_FILEDLG_EDIT_FAVORITES_LISTBOX" +#define HID_FILEDLG_EDIT_FAVORITES_HEADERBAR "SVT_HID_FILEDLG_EDIT_FAVORITES_HEADERBAR" +#define HID_FILEDLG_EXPORTASPDF "SVT_HID_FILEDLG_EXPORTASPDF" // HelpID's fuer die Textkomponente -#define HID_TEXTCPNT_OPEN_LINK (HID_SVTOOLS_START + 14) -#define HID_TEXTCPNT_OPEN_LINK_NEW (HID_SVTOOLS_START + 15) -#define HID_TEXTCPNT_DOWNLOAD (HID_SVTOOLS_START + 16) -#define HID_TEXTCPNT_ADD_BOOKMARK (HID_SVTOOLS_START + 17) -#define HID_TEXTCPNT_COPY_LINK (HID_SVTOOLS_START + 18) +#define HID_TEXTCPNT_OPEN_LINK "SVT_HID_TEXTCPNT_OPEN_LINK" +#define HID_TEXTCPNT_OPEN_LINK_NEW "SVT_HID_TEXTCPNT_OPEN_LINK_NEW" +#define HID_TEXTCPNT_DOWNLOAD "SVT_HID_TEXTCPNT_DOWNLOAD" +#define HID_TEXTCPNT_ADD_BOOKMARK "SVT_HID_TEXTCPNT_ADD_BOOKMARK" +#define HID_TEXTCPNT_COPY_LINK "SVT_HID_TEXTCPNT_COPY_LINK" // HelpID's fuer RegisterDialog -#define HID_LIMITED_DIALOG (HID_SVTOOLS_START + 20) +#define HID_LIMITED_DIALOG "SVT_HID_LIMITED_DIALOG" // Help ids of template dialog -#define HID_TEMPLATEDLG_DIALOG (HID_SVTOOLS_START + 21) -#define HID_TEMPLATEDLG_ICONCTRL (HID_SVTOOLS_START + 22) -#define HID_TEMPLATEDLG_FILEVIEW (HID_SVTOOLS_START + 23) -#define HID_TEMPLATEDLG_TB_BACK (HID_SVTOOLS_START + 24) -#define HID_TEMPLATEDLG_TB_PREV (HID_SVTOOLS_START + 25) -#define HID_TEMPLATEDLG_TB_PRINT (HID_SVTOOLS_START + 26) -#define HID_TEMPLATEDLG_TB_DOCINFO (HID_SVTOOLS_START + 27) -#define HID_TEMPLATEDLG_TB_PREVIEW (HID_SVTOOLS_START + 28) +#define HID_TEMPLATEDLG_DIALOG "SVT_HID_TEMPLATEDLG_DIALOG" +#define HID_TEMPLATEDLG_ICONCTRL "SVT_HID_TEMPLATEDLG_ICONCTRL" +#define HID_TEMPLATEDLG_FILEVIEW "SVT_HID_TEMPLATEDLG_FILEVIEW" +#define HID_TEMPLATEDLG_TB_BACK "SVT_HID_TEMPLATEDLG_TB_BACK" +#define HID_TEMPLATEDLG_TB_PREV "SVT_HID_TEMPLATEDLG_TB_PREV" +#define HID_TEMPLATEDLG_TB_PRINT "SVT_HID_TEMPLATEDLG_TB_PRINT" +#define HID_TEMPLATEDLG_TB_DOCINFO "SVT_HID_TEMPLATEDLG_TB_DOCINFO" +#define HID_TEMPLATEDLG_TB_PREVIEW "SVT_HID_TEMPLATEDLG_TB_PREVIEW" -#define HID_ADDRTEMPL_FIELD_ASSIGNMENT (HID_SVTOOLS_START + 29) +#define HID_ADDRTEMPL_FIELD_ASSIGNMENT "SVT_HID_ADDRTEMPL_FIELD_ASSIGNMENT" // Help ids for the filepicker dialogs -#define HID_EXPLORERDLG_FILE (HID_SVTOOLS_START + 30) +#define HID_EXPLORERDLG_FILE "SVT_HID_EXPLORERDLG_FILE" // help ids for fileview contextmenu -#define HID_FILEVIEW_MENU_DELETE (HID_SVTOOLS_START + 31) -#define HID_FILEVIEW_MENU_RENAME (HID_SVTOOLS_START + 32) +#define HID_FILEVIEW_MENU_DELETE "SVT_HID_FILEVIEW_MENU_DELETE" +#define HID_FILEVIEW_MENU_RENAME "SVT_HID_FILEVIEW_MENU_RENAME" // help ids for the different modi of the file picker dialog // FREE -#define HID_FILESAVE_LEVELUP (HID_SVTOOLS_START + 34) -#define HID_FILESAVE_CREATEDIRECTORY (HID_SVTOOLS_START + 35) -#define HID_FILESAVE_DEFAULTDIRECTORY (HID_SVTOOLS_START + 36) -#define HID_FILESAVE_FILEVIEW (HID_SVTOOLS_START + 37) -#define HID_FILESAVE_TEMPLATE (HID_SVTOOLS_START + 38) -#define HID_FILESAVE_FILEURL (HID_SVTOOLS_START + 39) -#define HID_FILESAVE_FILETYPE (HID_SVTOOLS_START + 40) -#define HID_FILESAVE_DOSAVE (HID_SVTOOLS_START + 41) -#define HID_FILESAVE_AUTOEXTENSION (HID_SVTOOLS_START + 42) -#define HID_FILESAVE_SAVEWITHPASSWORD (HID_SVTOOLS_START + 43) -#define HID_FILESAVE_CUSTOMIZEFILTER (HID_SVTOOLS_START + 44) -#define HID_FILESAVE_SELECTION (HID_SVTOOLS_START + 45) -#define HID_FILESAVE_DIALOG (HID_SVTOOLS_START + 46) -#define HID_FILESAVE_DOPLAY (HID_SVTOOLS_START + 47) - -#define HID_FILEOPEN_READONLY (HID_SVTOOLS_START + 48) -#define HID_FILEOPEN_VERSION (HID_SVTOOLS_START + 49) -#define HID_FILEOPEN_IMAGE_TEMPLATE (HID_SVTOOLS_START + 50) - -#define HID_FILEDLG_LINK_CB (HID_SFX_START + 276) -#define HID_FILEDLG_PREVIEW_CB (HID_SFX_START + 277) +#define HID_FILESAVE_LEVELUP "SVT_HID_FILESAVE_LEVELUP" +#define HID_FILESAVE_CREATEDIRECTORY "SVT_HID_FILESAVE_CREATEDIRECTORY" +#define HID_FILESAVE_DEFAULTDIRECTORY "SVT_HID_FILESAVE_DEFAULTDIRECTORY" +#define HID_FILESAVE_FILEVIEW "SVT_HID_FILESAVE_FILEVIEW" +#define HID_FILESAVE_TEMPLATE "SVT_HID_FILESAVE_TEMPLATE" +#define HID_FILESAVE_FILEURL "SVT_HID_FILESAVE_FILEURL" +#define HID_FILESAVE_FILETYPE "SVT_HID_FILESAVE_FILETYPE" +#define HID_FILESAVE_DOSAVE "SVT_HID_FILESAVE_DOSAVE" +#define HID_FILESAVE_AUTOEXTENSION "SVT_HID_FILESAVE_AUTOEXTENSION" +#define HID_FILESAVE_SAVEWITHPASSWORD "SVT_HID_FILESAVE_SAVEWITHPASSWORD" +#define HID_FILESAVE_CUSTOMIZEFILTER "SVT_HID_FILESAVE_CUSTOMIZEFILTER" +#define HID_FILESAVE_SELECTION "SVT_HID_FILESAVE_SELECTION" +#define HID_FILESAVE_DIALOG "SVT_HID_FILESAVE_DIALOG" +#define HID_FILESAVE_DOPLAY "SVT_HID_FILESAVE_DOPLAY" + +#define HID_FILEOPEN_READONLY "SVT_HID_FILEOPEN_READONLY" +#define HID_FILEOPEN_VERSION "SVT_HID_FILEOPEN_VERSION" +#define HID_FILEOPEN_IMAGE_TEMPLATE "SVT_HID_FILEOPEN_IMAGE_TEMPLATE" // uniqueid for the helpagent window (testtool) -#define HID_HELPAGENT_WINDOW (HID_SVTOOLS_START + 51) +#define HID_HELPAGENT_WINDOW "SVT_HID_HELPAGENT_WINDOW" // registration dialog -#define HID_REGISTRATION_DIALOG (HID_SVTOOLS_START + 52) +#define HID_REGISTRATION_DIALOG "SVT_HID_REGISTRATION_DIALOG" -#define HID_PRINTDIALOG_TOFILE (HID_SVTOOLS_START + 53) +#define HID_PRINTDIALOG_TOFILE "SVT_HID_PRINTDIALOG_TOFILE" -#define HID_WIZARD_NEXT (HID_SVTOOLS_START + 54) -#define HID_WIZARD_PREVIOUS (HID_SVTOOLS_START + 55) +#define HID_WIZARD_NEXT "SVT_HID_WIZARD_NEXT" +#define HID_WIZARD_PREVIOUS "SVT_HID_WIZARD_PREVIOUS" #endif diff --git a/svtools/inc/svtools/htmlout.hxx b/svtools/inc/svtools/htmlout.hxx index 888286b231ee..1a21f1154602 100644 --- a/svtools/inc/svtools/htmlout.hxx +++ b/svtools/inc/svtools/htmlout.hxx @@ -60,7 +60,7 @@ struct SVT_DLLPUBLIC HTMLOutContext struct HTMLOutFuncs { -#if defined(MAC) || defined(UNX) +#if defined(UNX) static const sal_Char sNewLine; // nur \012 oder \015 #else static const sal_Char __FAR_DATA sNewLine[]; // \015\012 diff --git a/svtools/inc/svtools/roadmapwizard.hxx b/svtools/inc/svtools/roadmapwizard.hxx index 5d8e0d9b01bb..25d983c85a90 100644 --- a/svtools/inc/svtools/roadmapwizard.hxx +++ b/svtools/inc/svtools/roadmapwizard.hxx @@ -90,8 +90,8 @@ namespace svt void SetRoadmapBitmap( const BitmapEx& _rBitmap ); const BitmapEx& GetRoadmapBitmap( ) const; - void SetRoadmapSmartHelpId( const SmartId& _rId, SmartIdUpdateMode _aMode = SMART_SET_SMART ); - SmartId GetRoadmapSmartHelpId() const; + void SetRoadmapHelpId( const rtl::OString& _rId ); + const rtl::OString& GetRoadmapHelpId() const; void SetRoadmapInteractive( sal_Bool _bInteractive ); sal_Bool IsRoadmapInteractive(); diff --git a/svtools/inc/svtools/rtfout.hxx b/svtools/inc/svtools/rtfout.hxx index 12a125635132..b9bfbc901848 100644 --- a/svtools/inc/svtools/rtfout.hxx +++ b/svtools/inc/svtools/rtfout.hxx @@ -41,7 +41,7 @@ class SvStream; class SVT_DLLPUBLIC RTFOutFuncs { public: -#if defined(MAC) || defined(UNX) +#if defined(UNX) static const sal_Char sNewLine; // nur \012 oder \015 #else static const sal_Char __FAR_DATA sNewLine[]; // \015\012 diff --git a/svtools/inc/svtools/svlbitm.hxx b/svtools/inc/svtools/svlbitm.hxx index c28b8d5db10c..5158c38fbd87 100644 --- a/svtools/inc/svtools/svlbitm.hxx +++ b/svtools/inc/svtools/svlbitm.hxx @@ -176,6 +176,8 @@ class SVT_DLLPUBLIC SvLBoxButton : public SvLBoxItem USHORT nItemFlags; USHORT nImgArrOffs; USHORT nBaseOffs; + + void ImplAdjustBoxSize( Size& io_rCtrlSize, ControlType i_eType, Window* pParent ); public: // An SvLBoxButton can be of three different kinds: an // enabled checkbox (the normal kind), a disabled checkbox diff --git a/svtools/inc/svtools/svtdata.hxx b/svtools/inc/svtools/svtdata.hxx index 1988813c613e..91a50a15c666 100644 --- a/svtools/inc/svtools/svtdata.hxx +++ b/svtools/inc/svtools/svtdata.hxx @@ -41,11 +41,10 @@ class ImpSvtData public: SfxItemDesruptorList_Impl * pItemDesruptList; ResMgr * pResMgr; - ResMgr * pPatchResMgr; private: ImpSvtData(): - pItemDesruptList(0), pResMgr(0), pPatchResMgr(0) + pItemDesruptList(0), pResMgr(0) {} ~ImpSvtData(); @@ -53,13 +52,12 @@ private: public: ResMgr * GetResMgr(const ::com::sun::star::lang::Locale aLocale); ResMgr * GetResMgr(); // VCL dependant, only available in SVT, not in SVL! - ResMgr * GetPatchResMgr(); - ResMgr * GetPatchResMgr(const ::com::sun::star::lang::Locale& aLocale); static ImpSvtData & GetSvtData(); }; //============================================================================ +<<<<<<< local class SvpResId: public ResId { @@ -73,6 +71,9 @@ public: class SVT_DLLPUBLIC SvtResId: public ResId +======= +class SvtResId: public ResId +>>>>>>> other { public: SvtResId(USHORT nId, const ::com::sun::star::lang::Locale aLocale); diff --git a/svtools/inc/svtools/svtools.hrc b/svtools/inc/svtools/svtools.hrc index 67607e1d281e..0461064f7d96 100644 --- a/svtools/inc/svtools/svtools.hrc +++ b/svtools/inc/svtools/svtools.hrc @@ -38,22 +38,12 @@ //............................................................................. // various unsorted stuff -#define DLG_EXPORT_PIX (RID_SVTOOLS_START+1) -#define DLG_EXPORT_VEC (RID_SVTOOLS_START+2) #define DLG_TWAIN_SOURCE (RID_SVTOOLS_START+3) #define DLG_SVT_EXPLORERFILE (RID_SVTOOLS_START+4) #define DLG_SVT_QUERYFOLDERNAME (RID_SVTOOLS_START+5) #define DLG_SVT_QUERYDELETE (RID_SVTOOLS_START+6) -#define EXPORT_DIALOG_TITLE (RID_SVTOOLS_START+4) -#define KEY_MODE (RID_SVTOOLS_START+5) -#define KEY_RES (RID_SVTOOLS_START+6) -#define KEY_SIZE (RID_SVTOOLS_START+7) - -#define KEY_COLORS (RID_SVTOOLS_START+9) -#define KEY_RLE_CODING (RID_SVTOOLS_START+10) - #define STR_SVT_AUTOMATIC_COLOR (RID_SVTOOLS_START+16) #define STR_SVT_FILEVIEW_COLUMN_TITLE (RID_SVTOOLS_START + 20) @@ -293,17 +283,16 @@ //............................................................................. // dialogs - -#define DLG_EXPORT_JPG_START (RID_SVTOOLS_START+110) -#define DLG_EXPORT_JPG (RID_SVTOOLS_START+111) -#define DLG_EXPORT_JPG_END (RID_SVTOOLS_START+112) +#define DLG_EXPORT_START (STR_ARR_SVT_LANGUAGE_TABLE_END + 1) +#define DLG_EXPORT (DLG_EXPORT_START) +#define DLG_EXPORT_TITLE (DLG_EXPORT_START+1) +#define DLG_EXPORT_END (DLG_EXPORT_TITLE) #define DLG_LOGIN (RID_SVTOOLS_START+113) #define DLG_ADDRESSBOOKSOURCE (RID_SVTOOLS_START+114) #define DLG_REGISTRATION_REQUEST (RID_SVTOOLS_START+115) -#define DLG_EXPORT_EPNG (RID_SVTOOLS_START+116) //............................................................................. // bitmaps diff --git a/svtools/inc/svtools/svtreebx.hxx b/svtools/inc/svtools/svtreebx.hxx index a600b91db1c4..787e0956888f 100644 --- a/svtools/inc/svtools/svtreebx.hxx +++ b/svtools/inc/svtools/svtreebx.hxx @@ -156,6 +156,7 @@ protected: virtual void CursorMoved( SvLBoxEntry* pNewCursor ); virtual void PreparePaint( SvLBoxEntry* ); virtual void DataChanged( const DataChangedEvent& rDCEvt ); + virtual void StateChanged( StateChangedType nStateChange ); void InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground); BOOL IsCellFocusEnabled() const; diff --git a/svtools/inc/svtools/svxbox.hxx b/svtools/inc/svtools/svxbox.hxx index 25deba4d091c..a4a920e692be 100644 --- a/svtools/inc/svtools/svxbox.hxx +++ b/svtools/inc/svtools/svxbox.hxx @@ -129,11 +129,7 @@ enum SvxComboBoxStyle SVX_CBS_LOWER = 0x02, SVX_CBS_ALL = 0x04, SVX_CBS_FILENAME = 0x08, -#ifdef WIN - SVX_CBS_SW_FILENAME = SVX_CBS_FILENAME | SVX_CBS_LOWER -#else SVX_CBS_SW_FILENAME = SVX_CBS_FILENAME -#endif }; // class SvxComboBox ----------------------------------------------------- diff --git a/svtools/inc/svtools/tabbar.hxx b/svtools/inc/svtools/tabbar.hxx index e036f4c2f045..2757811ba34e 100644 --- a/svtools/inc/svtools/tabbar.hxx +++ b/svtools/inc/svtools/tabbar.hxx @@ -516,8 +516,8 @@ public: XubString GetPageText( USHORT nPageId ) const; void SetHelpText( USHORT nPageId, const XubString& rText ); XubString GetHelpText( USHORT nPageId ) const; - void SetHelpId( USHORT nPageId, ULONG nHelpId ); - ULONG GetHelpId( USHORT nPageId ) const; + void SetHelpId( USHORT nPageId, const rtl::OString& nHelpId ); + rtl::OString GetHelpId( USHORT nPageId ) const; long GetSplitSize() const { return mnSplitSize; } long GetMinSize() const; @@ -526,9 +526,9 @@ public: { Window::SetHelpText( rText ); } XubString GetHelpText() const { return Window::GetHelpText(); }; - void SetHelpId( ULONG nId ) - { Window::SetHelpId( nId ); } - ULONG GetHelpId() const + void SetHelpId( const rtl::OString& rId ) + { Window::SetHelpId( rId ); } + const rtl::OString& GetHelpId() const { return Window::GetHelpId(); } void SetStyle( WinBits nStyle ); diff --git a/svtools/inc/svtools/table/tabledatawindow.hxx b/svtools/inc/svtools/table/tabledatawindow.hxx index 9a6ece489119..829feecd5836 100644 --- a/svtools/inc/svtools/table/tabledatawindow.hxx +++ b/svtools/inc/svtools/table/tabledatawindow.hxx @@ -55,7 +55,6 @@ namespace svt { namespace table Link m_aMouseButtonDownHdl; Link m_aMouseButtonUpHdl; Link m_aSelectHdl; - RowPos m_nRowAlreadySelected; public: TableDataWindow( TableControl_Impl& _rTableControl ); inline void SetMouseButtonDownHdl( const Link& rLink ) { m_aMouseButtonDownHdl = rLink; } diff --git a/svtools/inc/svtools/taskbar.hxx b/svtools/inc/svtools/taskbar.hxx index 46853fa07c03..d4a6699e2d5e 100644 --- a/svtools/inc/svtools/taskbar.hxx +++ b/svtools/inc/svtools/taskbar.hxx @@ -268,7 +268,7 @@ private: Image maImage; XubString maQuickHelpText; XubString maHelpText; - ULONG mnHelpId; + rtl::OString maHelpId; USHORT mnFlags; public: @@ -289,8 +289,8 @@ public: const XubString& GetQuickHelpText() const { return maQuickHelpText; } void SetHelpText( const XubString& rStr ) { maHelpText = rStr; } const XubString& GetHelpText() const { return maHelpText; } - void SetHelpId( ULONG nHelpId ) { mnHelpId = nHelpId; } - ULONG GetHelpId() const { return mnHelpId; } + void SetHelpId( const rtl::OString& rHelpId ) { maHelpId = rHelpId; } + const rtl::OString& GetHelpId() const { return maHelpId; } void SetFlags( USHORT nFlags ) { mnFlags = nFlags; } USHORT GetFlags() const { return mnFlags; } diff --git a/svtools/inc/svtools/toolpanel/toolpanel.hxx b/svtools/inc/svtools/toolpanel/toolpanel.hxx index 432dea64e8b5..d38d8e7d257d 100644 --- a/svtools/inc/svtools/toolpanel/toolpanel.hxx +++ b/svtools/inc/svtools/toolpanel/toolpanel.hxx @@ -32,7 +32,6 @@ #include <rtl/ustring.hxx> #include <vcl/image.hxx> -#include <vcl/smartid.hxx> #include <boost/noncopyable.hpp> @@ -62,7 +61,7 @@ namespace svt virtual Image GetImage() const = 0; /// retrieves the help ID associated with the panel, if any. - virtual SmartId GetHelpID() const = 0; + virtual rtl::OString GetHelpID() const = 0; /** activates the panel diff --git a/svtools/prj/d.lst b/svtools/prj/d.lst index b46ddef72311..7b9c6a1957e3 100644 --- a/svtools/prj/d.lst +++ b/svtools/prj/d.lst @@ -38,3 +38,6 @@ dos: sh -c "if test %OS% = MACOSX; then macosx-create-bundle %_DEST%\bin%_EXT%\b *.xml %_DEST%\xml%_EXT%\*.xml +..\%__SRC%\misc\hatchwindowfactory.component %_DEST%\xml%_EXT%\hatchwindowfactory.component +..\%__SRC%\misc\productregistration.uno.component %_DEST%\xml%_EXT%\productregistration.uno.component +..\%__SRC%\misc\svt.component %_DEST%\xml%_EXT%\svt.component diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx index 68cf316e813b..53c2a5ac86f6 100644 --- a/svtools/source/brwbox/brwbox2.cxx +++ b/svtools/source/brwbox/brwbox2.cxx @@ -613,13 +613,6 @@ void BrowseBox::Resize() if (IsZoom()) nSBSize = (ULONG)(nSBSize * (double)GetZoom()); - long nSize = pDataWin->GetPosPixel().Y(); - if( !getDataWindow()->bNoHScroll ) - nSize += aHScroll.GetSizePixel().Height(); - - if ( GetOutputSizePixel().Height() < nSize ) - return; - DoHideCursor( "Resize" ); USHORT nOldVisibleRows = (USHORT)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1); diff --git a/svtools/source/config/menuoptions.cxx b/svtools/source/config/menuoptions.cxx index 70d9d1623ef2..e33251050b81 100644 --- a/svtools/source/config/menuoptions.cxx +++ b/svtools/source/config/menuoptions.cxx @@ -314,8 +314,16 @@ void SvtMenuOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames ) // We need values from ALL notified configuration keys. DBG_ASSERT( !(seqPropertyNames.getLength()!=seqValues.getLength()), "SvtMenuOptions_Impl::Notify()\nI miss some values of configuration keys!\n" ); - sal_Bool bMenuIcons = true; - sal_Bool bSystemMenuIcons = true; + sal_Bool bMenuSettingsChanged = sal_False; + sal_Bool bMenuIcons = sal_True; + sal_Bool bSystemMenuIcons = sal_True; + if (m_nMenuIcons == 2) + bMenuIcons = (sal_Bool)(Application::GetSettings().GetStyleSettings().GetUseImagesInMenus()); + else + { + bSystemMenuIcons = sal_False; + bMenuIcons = m_nMenuIcons ? sal_True : sal_False; + } // Step over list of property names and get right value from coreesponding value list to set it on internal members! sal_Int32 nCount = seqPropertyNames.getLength(); @@ -334,12 +342,12 @@ void SvtMenuOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames ) else if( seqPropertyNames[nProperty] == PROPERTYNAME_SHOWICONSINMENUES ) { DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nWho has changed the value type of \"Office.Common\\View\\Menu\\ShowIconsInMenues\"?" ); - seqValues[nProperty] >>= bMenuIcons; + bMenuSettingsChanged = seqValues[nProperty] >>= bMenuIcons; } else if( seqPropertyNames[nProperty] == PROPERTYNAME_SYSTEMICONSINMENUES ) { DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nWho has changed the value type of \"Office.Common\\View\\Menu\\IsSystemIconsInMenus\"?" ); - seqValues[nProperty] >>= bSystemMenuIcons; + bMenuSettingsChanged = seqValues[nProperty] >>= bSystemMenuIcons; } #if OSL_DEBUG_LEVEL > 1 @@ -347,7 +355,8 @@ void SvtMenuOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames ) #endif } - m_nMenuIcons = bSystemMenuIcons ? 2 : bMenuIcons; + if ( bMenuSettingsChanged ) + m_nMenuIcons = bSystemMenuIcons ? 2 : bMenuIcons; for ( USHORT n=0; n<aList.Count(); n++ ) aList.GetObject(n)->Call( this ); @@ -377,11 +386,13 @@ void SvtMenuOptions_Impl::Commit() break; //Output cache of current setting as possibly modified by System Theme for older version case PROPERTYHANDLE_SHOWICONSINMENUES : { - seqValues[nProperty] <<=(sal_Bool)(Application::GetSettings().GetStyleSettings().GetUseImagesInMenus()); + sal_Bool bValue = (sal_Bool)(Application::GetSettings().GetStyleSettings().GetUseImagesInMenus()); + seqValues[nProperty] <<= bValue; } break; case PROPERTYHANDLE_SYSTEMICONSINMENUES : { - seqValues[nProperty] <<= (m_nMenuIcons == 2 ? sal_True : sal_False) ; + sal_Bool bValue = (m_nMenuIcons == 2 ? sal_True : sal_False) ; + seqValues[nProperty] <<= bValue; } break; } diff --git a/svtools/source/contnr/ctrdll.cxx b/svtools/source/contnr/ctrdll.cxx deleted file mode 100644 index 463c6ccc8b35..000000000000 --- a/svtools/source/contnr/ctrdll.cxx +++ /dev/null @@ -1,79 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svtools.hxx" - -#ifdef WIN -#include <svwin.h> - -#ifndef _SYSDEP_HXX -#include <sysdep.hxx> -#endif - -// Statische DLL-Verwaltungs-Variablen -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - - -/*************************************************************************** -|* -|* LibMain() -|* -|* Beschreibung Initialisierungsfunktion der DLL -|* Ersterstellung TH 05.05.93 -|* Letzte Aenderung TH 05.05.93 -|* -***************************************************************************/ - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -/*************************************************************************** -|* -|* WEP() -|* -|* Beschreibung DLL-Deinitialisierung -|* Ersterstellung TH 05.05.93 -|* Letzte Aenderung TH 05.05.93 -|* -***************************************************************************/ - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index 1a34354603fa..c9b9b23786b4 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -1442,16 +1442,16 @@ sal_Bool SvtFileView::GetParentURL( String& rParentURL ) const // ----------------------------------------------------------------------- -sal_uInt32 SvtFileView::GetHelpId( ) const +const rtl::OString& SvtFileView::GetHelpId( ) const { return mpImp->mpView->GetHelpId( ); } // ----------------------------------------------------------------------- -void SvtFileView::SetHelpId( sal_uInt32 nHelpId ) +void SvtFileView::SetHelpId( const rtl::OString& rHelpId ) { - mpImp->mpView->SetHelpId( nHelpId ); + mpImp->mpView->SetHelpId( rHelpId ); } // ----------------------------------------------------------------------- diff --git a/svtools/source/contnr/fileview.src b/svtools/source/contnr/fileview.src index f40530c10347..bcb282f44615 100644 --- a/svtools/source/contnr/fileview.src +++ b/svtools/source/contnr/fileview.src @@ -110,6 +110,7 @@ Menu RID_FILEVIEW_CONTEXTMENU ModalDialog DLG_SVT_QUERYDELETE { + HelpID = "svtools:ModalDialog:DLG_SVT_QUERYDELETE"; SVLook = TRUE ; OutputSize = TRUE ; Moveable = TRUE ; @@ -142,6 +143,7 @@ ModalDialog DLG_SVT_QUERYDELETE PushButton BTN_YES { + HelpID = "svtools:PushButton:DLG_SVT_QUERYDELETE:BTN_YES"; Pos = MAP_APPFONT ( 6 , 47 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -151,6 +153,7 @@ ModalDialog DLG_SVT_QUERYDELETE PushButton BTN_ALL { + HelpID = "svtools:PushButton:DLG_SVT_QUERYDELETE:BTN_ALL"; Pos = MAP_APPFONT ( 59 , 47 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -160,6 +163,7 @@ ModalDialog DLG_SVT_QUERYDELETE PushButton BTN_NO { + HelpID = "svtools:PushButton:DLG_SVT_QUERYDELETE:BTN_NO"; Pos = MAP_APPFONT ( 112 , 47 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; diff --git a/svtools/source/contnr/svicnvw.cxx b/svtools/source/contnr/svicnvw.cxx index 20bcfe0fe33a..b16cd67d12a5 100644 --- a/svtools/source/contnr/svicnvw.cxx +++ b/svtools/source/contnr/svicnvw.cxx @@ -550,9 +550,6 @@ void SvIconView::EditItemText( SvLBoxEntry* pEntry, SvLBoxItem* pItem, aRect.Bottom() += 2; // sieht huebscher aus -#ifdef WIN - aRect.Bottom() += 4; -#endif #ifdef OS2 #if OS2_SINGLE_LINE_EDIT diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index 1b791ab8d904..7a06c4a30735 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -1059,14 +1059,14 @@ void SvImpLBox::DrawNet() //so that SvImpLBox::DrawNet() doesn't draw anything too if(pView->IsNativeControlSupported( CTRL_LISTNET, PART_ENTIRE_CONTROL)) { ImplControlValue aControlValue; - Point aTemp(0,0); // temporary needed for g++ 3.3.5 - Region aCtrlRegion( Rectangle(aTemp, Size( 0, 0 )) ); + Point aTemp(0,0); // temporary needed for g++ 3.3.5 + Rectangle aCtrlRegion( aTemp, Size( 0, 0 ) ); ControlState nState = CTRL_STATE_ENABLED; - if( pView->DrawNativeControl( CTRL_LISTNET, PART_ENTIRE_CONTROL, - aCtrlRegion, nState, aControlValue, rtl::OUString() ) ) - { - return; - } + if( pView->DrawNativeControl( CTRL_LISTNET, PART_ENTIRE_CONTROL, + aCtrlRegion, nState, aControlValue, rtl::OUString() ) ) + { + return; + } } @@ -2164,14 +2164,6 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt ) SelAllDestrAnch( FALSE, TRUE ); // DeselectAll(); SetCursor( pEntry ); - DBG_ERROR( "Please report what you did to get this assertion to FS!" ); - // The entry which has been double-clicked changed - and we select it, again. - // I have situations where this behaviour does not make any sense at all - even more, it - // leads to hacks to revert it's results. - // So I'm not sure if this behaviour here is nonsense (which I believe at the moment), - // or if there are really scenarious where it dones make sense .... - // 07.12.2001 - 95727 - fs@openoffice.org - return; } if( pEntry->HasChilds() || pEntry->HasChildsOnDemand() ) diff --git a/svtools/source/contnr/svimpicn.cxx b/svtools/source/contnr/svimpicn.cxx index 2d4c9cf2df0e..d1e471953663 100644 --- a/svtools/source/contnr/svimpicn.cxx +++ b/svtools/source/contnr/svimpicn.cxx @@ -1702,11 +1702,6 @@ void SvImpIconView::PositionScrollBars( long nRealWidth, long nRealHeight ) Point aPos( 0, nRealHeight ); aPos.Y() -= nHorSBarHeight; -#ifdef WIN - // vom linken und unteren Rand ein Pixel abschneiden - aPos.Y()++; - aPos.X()--; -#endif #ifdef OS2 aPos.Y()++; #endif @@ -1717,7 +1712,7 @@ void SvImpIconView::PositionScrollBars( long nRealWidth, long nRealHeight ) aPos.X() = nRealWidth; aPos.Y() = 0; aPos.X() -= nVerSBarWidth; -#if defined(WIN) || defined(WNT) +#if defined(WNT) aPos.X()++; aPos.Y()--; #endif @@ -1809,7 +1804,7 @@ void SvImpIconView::AdjustScrollBars() // size ver scrollbar long nThumb = aVerSBar.GetThumbPos(); Size aSize( nVerSBarWidth, nRealHeight ); -#if defined(WIN) || defined(WNT) +#if defined(WNT) aSize.Height() += 2; #endif #ifdef OS2 @@ -1834,7 +1829,7 @@ void SvImpIconView::AdjustScrollBars() nThumb = aHorSBar.GetThumbPos(); aSize.Width() = nRealWidth; aSize.Height() = nHorSBarHeight; -#if defined(WIN) || defined(WNT) +#if defined(WNT) aSize.Width()++; #endif #ifdef OS2 @@ -1842,7 +1837,7 @@ void SvImpIconView::AdjustScrollBars() if( nResult & 0x0001 ) // vertikale Scrollbar ? aSize.Width()--; #endif -#if defined(WIN) || defined(WNT) +#if defined(WNT) if( nResult & 0x0001 ) // vertikale Scrollbar ? { aSize.Width()++; @@ -1868,7 +1863,7 @@ void SvImpIconView::AdjustScrollBars() nRealWidth++; #endif aOutputSize.Width() = nRealWidth; -#if defined(WIN) || defined(WNT) +#if defined(WNT) if( nResult & 0x0002 ) // hor scrollbar ? nRealHeight++; // weil unterer Rand geclippt wird #endif diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx index 82321b53259e..d260f984c2b0 100644 --- a/svtools/source/contnr/svlbitm.cxx +++ b/svtools/source/contnr/svlbitm.cxx @@ -406,7 +406,7 @@ BOOL SvLBoxButton::ClickHdl( SvLBox*, SvLBoxEntry* pEntry ) } void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */, - SvLBoxEntry* ) + SvLBoxEntry* /*pEntry*/ ) { DBG_CHKTHIS(SvLBoxButton,0); USHORT nIndex = eKind == SvLBoxButtonKind_staticImage @@ -418,14 +418,13 @@ void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */, //Native drawing /// BOOL bNativeOK = FALSE; - Window *pWin = NULL; - if( rDev.GetOutDevType() == OUTDEV_WINDOW ) - pWin = (Window*) &rDev; - - if ( nIndex != SV_BMP_STATICIMAGE && pWin && pWin->IsNativeControlSupported( (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX, PART_ENTIRE_CONTROL) ) + ControlType eCtrlType = (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX; + if ( nIndex != SV_BMP_STATICIMAGE && rDev.IsNativeControlSupported( eCtrlType, PART_ENTIRE_CONTROL) ) { + Size aSize(pData->Width(), pData->Height()); + ImplAdjustBoxSize( aSize, eCtrlType, &rDev ); ImplControlValue aControlValue; - Region aCtrlRegion( Rectangle(rPos, Size(pData->Width(), pData->Height())) ); + Rectangle aCtrlRegion( rPos, aSize ); ControlState nState = 0; //states CTRL_STATE_DEFAULT, CTRL_STATE_PRESSED and CTRL_STATE_ROLLOVER are not implemented @@ -439,7 +438,7 @@ void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */, else if ( IsStateTristate() ) aControlValue.setTristateVal( BUTTONVALUE_MIXED ); - bNativeOK = pWin->DrawNativeControl( (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX, PART_ENTIRE_CONTROL, + bNativeOK = rDev.DrawNativeControl( eCtrlType, PART_ENTIRE_CONTROL, aCtrlRegion, nState, aControlValue, rtl::OUString() ); } @@ -459,13 +458,47 @@ void SvLBoxButton::Clone( SvLBoxItem* pSource ) pData = ((SvLBoxButton*)pSource)->pData; } +void SvLBoxButton::ImplAdjustBoxSize( Size& io_rSize, ControlType i_eType, Window* i_pParent ) +{ + if ( i_pParent->IsNativeControlSupported( i_eType, PART_ENTIRE_CONTROL) ) + { + ImplControlValue aControlValue; + Rectangle aCtrlRegion( Point( 0, 0 ), io_rSize ); + ControlState nState = CTRL_STATE_ENABLED; + + aControlValue.setTristateVal( BUTTONVALUE_ON ); + + Rectangle aNativeBounds, aNativeContent; + bool bNativeOK = i_pParent->GetNativeControlRegion( i_eType, + PART_ENTIRE_CONTROL, + aCtrlRegion, + nState, + aControlValue, + rtl::OUString(), + aNativeBounds, + aNativeContent ); + if( bNativeOK ) + { + Size aContentSize( aNativeContent.GetSize() ); + // leave a little space around the box image (looks better + if( aContentSize.Height() + 2 > io_rSize.Height() ) + io_rSize.Height() = aContentSize.Height() + 2; + } + } +} + void SvLBoxButton::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry, SvViewDataItem* pViewData ) { DBG_CHKTHIS(SvLBoxButton,0); if( !pViewData ) pViewData = pView->GetViewDataItem( pEntry, this ); - pViewData->aSize = Size( pData->Width(), pData->Height() ); + Size aSize( pData->Width(), pData->Height() ); + + ControlType eCtrlType = (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX; + if ( eKind != SvLBoxButtonKind_staticImage && pView ) + ImplAdjustBoxSize( aSize, eCtrlType, pView ); + pViewData->aSize = aSize; } bool SvLBoxButton::CheckModification() const diff --git a/svtools/source/contnr/svlbox.cxx b/svtools/source/contnr/svlbox.cxx index fb71f64772ad..a69253c69629 100644 --- a/svtools/source/contnr/svlbox.cxx +++ b/svtools/source/contnr/svlbox.cxx @@ -1518,6 +1518,13 @@ void SvLBox::MakeVisible( SvLBoxEntry* ) void SvLBox::Command( const CommandEvent& i_rCommandEvent ) { DBG_CHKTHIS(SvLBox,0); + + if ( COMMAND_STARTDRAG == i_rCommandEvent.GetCommand() ) + { + Point aEventPos( i_rCommandEvent.GetMousePosPixel() ); + MouseEvent aMouseEvt( aEventPos, 1, MOUSE_SELECT, MOUSE_LEFT ); + MouseButtonUp( aMouseEvt ); + } Control::Command( i_rCommandEvent ); } @@ -1775,6 +1782,10 @@ void SvLBox::StartDrag( sal_Int8, const Point& rPosPixel ) { DBG_CHKTHIS(SvLBox,0); + Point aEventPos( rPosPixel ); + MouseEvent aMouseEvt( aEventPos, 1, MOUSE_SELECT, MOUSE_LEFT ); + MouseButtonUp( aMouseEvt ); + nOldDragMode = GetDragDropMode(); if ( !nOldDragMode ) return; diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx index c1c746f2dd63..e8863ebaf43f 100644 --- a/svtools/source/contnr/svtreebx.cxx +++ b/svtools/source/contnr/svtreebx.cxx @@ -1814,7 +1814,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags, if ( IsNativeControlSupported( CTRL_LISTNODE, PART_ENTIRE_CONTROL) ) { ImplControlValue aControlValue; - Region aCtrlRegion( Rectangle(aPos, pImg->GetSizePixel() ) ); + Rectangle aCtrlRegion( aPos, pImg->GetSizePixel() ); ControlState nState = 0; if ( IsEnabled() ) nState |= CTRL_STATE_ENABLED; @@ -2516,6 +2516,11 @@ void SvTreeListBox::DataChanged( const DataChangedEvent& rDCEvt ) Control::DataChanged( rDCEvt ); } +void SvTreeListBox::StateChanged( StateChangedType i_nStateChange ) +{ + SvLBox::StateChanged( i_nStateChange ); +} + void SvTreeListBox::InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); diff --git a/svtools/source/contnr/templwin.src b/svtools/source/contnr/templwin.src index 3b0dff5d12e6..113e20c34f28 100644 --- a/svtools/source/contnr/templwin.src +++ b/svtools/source/contnr/templwin.src @@ -289,12 +289,14 @@ ModalDialog DLG_DOCTEMPLATE }; PushButton BTN_DOCTEMPLATE_MANAGE { + HelpID = "svtools:PushButton:DLG_DOCTEMPLATE:BTN_DOCTEMPLATE_MANAGE"; Pos = MAP_APPFONT( 6, 230 ); Size = MAP_APPFONT( 50, 14 ); Text [ en-US ] = "Organi~ze..."; }; PushButton BTN_DOCTEMPLATE_EDIT { + HelpID = "svtools:PushButton:DLG_DOCTEMPLATE:BTN_DOCTEMPLATE_EDIT"; Pos = MAP_APPFONT( 59, 230 ); Size = MAP_APPFONT( 50, 14 ); Text [ en-US ] = "~Edit"; diff --git a/svtools/source/contnr/treelist.cxx b/svtools/source/contnr/treelist.cxx index 3395dffc28f5..1b96f1ac89e4 100644 --- a/svtools/source/contnr/treelist.cxx +++ b/svtools/source/contnr/treelist.cxx @@ -139,16 +139,6 @@ void SvTreeEntryList::DestroyAll() } - - -#if defined (WIN) && defined (MSC) -// siehe BugId 42896: Die Funktionen Prev, PrevVisible, Next, NextVisible -// (andere?) funktionieren nicht mit Optimierung. -#pragma optimize ("", off) -#endif - - - /************************************************************************* |* |* SvTreeList:: diff --git a/svtools/source/control/ctrldll.cxx b/svtools/source/control/ctrldll.cxx deleted file mode 100644 index 2f3ff037be31..000000000000 --- a/svtools/source/control/ctrldll.cxx +++ /dev/null @@ -1,78 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svtools.hxx" - -#ifdef WIN -#include <svwin.h> - -#ifndef _SYSDEP_HXX -#include <sysdep.hxx> -#endif - -// Statische DLL-Verwaltungs-Variablen -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - -/*************************************************************************** -|* -|* LibMain() -|* -|* Beschreibung Initialisierungsfunktion der DLL -|* Ersterstellung TH 05.05.93 -|* Letzte Aenderung TH 05.05.93 -|* -***************************************************************************/ - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -/*************************************************************************** -|* -|* WEP() -|* -|* Beschreibung DLL-Deinitialisierung -|* Ersterstellung TH 05.05.93 -|* Letzte Aenderung TH 05.05.93 -|* -***************************************************************************/ - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx index 1ae223bebf06..7b1f2ad87108 100644..100755 --- a/svtools/source/control/headbar.cxx +++ b/svtools/source/control/headbar.cxx @@ -53,7 +53,7 @@ struct ImplHeadItem USHORT mnId; HeaderBarItemBits mnBits; long mnSize; - ULONG mnHelpId; + rtl::OString maHelpId; Image maImage; XubString maOutText; XubString maText; @@ -1132,13 +1132,13 @@ void HeaderBar::RequestHelp( const HelpEvent& rHEvt ) } else if ( rHEvt.GetMode() & HELPMODE_EXTENDED ) { - ULONG nHelpId = GetHelpId( nItemId ); - if ( nHelpId ) + rtl::OUString aHelpId( rtl::OStringToOUString( GetHelpId( nItemId ), RTL_TEXTENCODING_UTF8 ) ); + if ( aHelpId.getLength() ) { // Wenn eine Hilfe existiert, dann ausloesen Help* pHelp = Application::GetHelp(); if ( pHelp ) - pHelp->Start( nHelpId, this ); + pHelp->Start( aHelpId, this ); return; } } @@ -1266,7 +1266,6 @@ void HeaderBar::InsertItem( USHORT nItemId, const XubString& rText, pItem->mnId = nItemId; pItem->mnBits = nBits; pItem->mnSize = nSize; - pItem->mnHelpId = 0; pItem->maText = rText; pItem->mpUserData = 0; mpItemList->Insert( pItem, nPos ); @@ -1291,7 +1290,6 @@ void HeaderBar::InsertItem( USHORT nItemId, pItem->mnId = nItemId; pItem->mnBits = nBits; pItem->mnSize = nSize; - pItem->mnHelpId = 0; pItem->maImage = rImage; pItem->maText = rText; pItem->mpUserData = 0; @@ -1563,11 +1561,11 @@ XubString HeaderBar::GetHelpText( USHORT nItemId ) const if ( nPos != HEADERBAR_ITEM_NOTFOUND ) { ImplHeadItem* pItem = mpItemList->GetObject( nPos ); - if ( !pItem->maHelpText.Len() && pItem->mnHelpId ) + if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() ) { Help* pHelp = Application::GetHelp(); if ( pHelp ) - pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this ); + pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this ); } return pItem->maHelpText; @@ -1578,22 +1576,22 @@ XubString HeaderBar::GetHelpText( USHORT nItemId ) const // ----------------------------------------------------------------------- -void HeaderBar::SetHelpId( USHORT nItemId, ULONG nHelpId ) +void HeaderBar::SetHelpId( USHORT nItemId, const rtl::OString& rHelpId ) { USHORT nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) - mpItemList->GetObject( nPos )->mnHelpId = nHelpId; + mpItemList->GetObject( nPos )->maHelpId = rHelpId; } // ----------------------------------------------------------------------- -ULONG HeaderBar::GetHelpId( USHORT nItemId ) const +rtl::OString HeaderBar::GetHelpId( USHORT nItemId ) const { USHORT nPos = GetItemPos( nItemId ); + rtl::OString aRet; if ( nPos != HEADERBAR_ITEM_NOTFOUND ) - return mpItemList->GetObject( nPos )->mnHelpId; - else - return 0; + aRet = mpItemList->GetObject( nPos )->maHelpId; + return aRet; } // ----------------------------------------------------------------------- diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx index 769d0dcb6008..4acb54de7c3f 100644..100755 --- a/svtools/source/control/inettbc.cxx +++ b/svtools/source/control/inettbc.cxx @@ -845,7 +845,7 @@ SvtURLBox::SvtURLBox( Window* pParent, const ResId& _rResId, INetProtocol eSmart void SvtURLBox::ImplInit() { pImp = new SvtURLBox_Impl(); - SetHelpId( SID_OPENURL ); + SetHelpId( ".uno:OpenURL" ); EnableAutocomplete( FALSE ); SetText( String() ); diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index 36d1e6c3b5c4..0c2800246061 100755 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -60,7 +60,7 @@ struct ImplTabBarItem XubString maHelpText; Rectangle maRect; long mnWidth; - ULONG mnHelpId; + rtl::OString maHelpId; BOOL mbShort; BOOL mbSelect; BOOL mbEnable; @@ -76,7 +76,6 @@ struct ImplTabBarItem mnId = nItemId; mnBits = nPageBits; mnWidth = 0; - mnHelpId = 0; mbShort = FALSE; mbSelect = FALSE; mbEnable = TRUE; @@ -1394,13 +1393,13 @@ void TabBar::RequestHelp( const HelpEvent& rHEvt ) } else if ( rHEvt.GetMode() & HELPMODE_EXTENDED ) { - ULONG nHelpId = GetHelpId( nItemId ); - if ( nHelpId ) + rtl::OUString aHelpId( rtl::OStringToOUString( GetHelpId( nItemId ), RTL_TEXTENCODING_UTF8 ) ); + if ( aHelpId.getLength() ) { // Wenn eine Hilfe existiert, dann ausloesen Help* pHelp = Application::GetHelp(); if ( pHelp ) - pHelp->Start( nHelpId, this ); + pHelp->Start( aHelpId, this ); return; } } @@ -2400,11 +2399,11 @@ XubString TabBar::GetHelpText( USHORT nPageId ) const if ( nPos != PAGE_NOT_FOUND ) { ImplTabBarItem* pItem = mpItemList->GetObject( nPos ); - if ( !pItem->maHelpText.Len() && pItem->mnHelpId ) + if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() ) { Help* pHelp = Application::GetHelp(); if ( pHelp ) - pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this ); + pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this ); } return pItem->maHelpText; @@ -2415,22 +2414,22 @@ XubString TabBar::GetHelpText( USHORT nPageId ) const // ----------------------------------------------------------------------- -void TabBar::SetHelpId( USHORT nPageId, ULONG nHelpId ) +void TabBar::SetHelpId( USHORT nPageId, const rtl::OString& rHelpId ) { USHORT nPos = GetPagePos( nPageId ); if ( nPos != PAGE_NOT_FOUND ) - mpItemList->GetObject( nPos )->mnHelpId = nHelpId; + mpItemList->GetObject( nPos )->maHelpId = rHelpId; } // ----------------------------------------------------------------------- -ULONG TabBar::GetHelpId( USHORT nPageId ) const +rtl::OString TabBar::GetHelpId( USHORT nPageId ) const { USHORT nPos = GetPagePos( nPageId ); + rtl::OString aRet; if ( nPos != PAGE_NOT_FOUND ) - return mpItemList->GetObject( nPos )->mnHelpId; - else - return 0; + aRet = mpItemList->GetObject( nPos )->maHelpId; + return aRet; } // ----------------------------------------------------------------------- diff --git a/svtools/source/control/taskstat.cxx b/svtools/source/control/taskstat.cxx index 9d8774493da6..2e1cffcaac10 100644..100755 --- a/svtools/source/control/taskstat.cxx +++ b/svtools/source/control/taskstat.cxx @@ -514,13 +514,13 @@ void TaskStatusBar::RequestHelp( const HelpEvent& rHEvt ) { if ( pItem ) { - ULONG nHelpId = pItem->maItem.GetHelpId(); - if ( nHelpId ) + rtl::OUString aHelpId( rtl::OStringToOUString( pItem->maItem.GetHelpId(), RTL_TEXTENCODING_UTF8 ) ); + if ( aHelpId.getLength() ) { // Wenn eine Hilfe existiert, dann ausloesen Help* pHelp = Application::GetHelp(); if ( pHelp ) - pHelp->Start( nHelpId, this ); + pHelp->Start( aHelpId, this ); return; } } diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx index fa393da3d5a8..f0bd192fc02c 100644 --- a/svtools/source/control/toolbarmenu.cxx +++ b/svtools/source/control/toolbarmenu.cxx @@ -920,7 +920,7 @@ void ToolbarMenu::implHighlightEntry( int nHighlightEntry, bool bHighlight ) IntersectClipRegion( Rectangle( Point( nX, nY ), Size( aSz.Width(), pEntry->maSize.Height() ) ) ); Rectangle aCtrlRect( Point( nX, 0 ), Size( aPxSize.Width()-nX, aPxSize.Height() ) ); DrawNativeControl( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, - Region( aCtrlRect ), + aCtrlRect, CTRL_STATE_ENABLED, ImplControlValue(), OUString() ); @@ -928,7 +928,7 @@ void ToolbarMenu::implHighlightEntry( int nHighlightEntry, bool bHighlight ) { bDrawItemRect = false; if( FALSE == DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM, - Region( aItemRect ), + aItemRect, CTRL_STATE_SELECTED | ( pEntry->mbEnabled? CTRL_STATE_ENABLED: 0 ), ImplControlValue(), OUString() ) ) @@ -1312,13 +1312,12 @@ static void ImplPaintCheckBackground( Window* i_pWindow, const Rectangle& i_rRec if( i_pWindow->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) ) { ImplControlValue aControlValue; - Region aCtrlRegion( i_rRect ); ControlState nState = CTRL_STATE_PRESSED | CTRL_STATE_ENABLED; aControlValue.setTristateVal( BUTTONVALUE_ON ); bNativeOk = i_pWindow->DrawNativeControl( CTRL_TOOLBAR, PART_BUTTON, - aCtrlRegion, nState, aControlValue, + i_rRect, nState, aControlValue, rtl::OUString() ); } @@ -1335,10 +1334,10 @@ static long ImplGetNativeCheckAndRadioSize( Window* pWin, long& rCheckHeight, lo rMaxWidth = rCheckHeight = rRadioHeight = 0; ImplControlValue aVal; - Region aNativeBounds; - Region aNativeContent; + Rectangle aNativeBounds; + Rectangle aNativeContent; Point tmp( 0, 0 ); - Region aCtrlRegion( Rectangle( tmp, Size( 100, 15 ) ) ); + Rectangle aCtrlRegion( tmp, Size( 100, 15 ) ); if( pWin->IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM_CHECK_MARK ) ) { if( pWin->GetNativeControlRegion( ControlType(CTRL_MENU_POPUP), @@ -1351,8 +1350,8 @@ static long ImplGetNativeCheckAndRadioSize( Window* pWin, long& rCheckHeight, lo aNativeContent ) ) { - rCheckHeight = aNativeBounds.GetBoundRect().GetHeight(); - rMaxWidth = aNativeContent.GetBoundRect().GetWidth(); + rCheckHeight = aNativeBounds.GetHeight(); + rMaxWidth = aNativeContent.GetWidth(); } } if( pWin->IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM_RADIO_MARK ) ) @@ -1367,8 +1366,8 @@ static long ImplGetNativeCheckAndRadioSize( Window* pWin, long& rCheckHeight, lo aNativeContent ) ) { - rRadioHeight = aNativeBounds.GetBoundRect().GetHeight(); - rMaxWidth = Max (rMaxWidth, aNativeContent.GetBoundRect().GetWidth()); + rRadioHeight = aNativeBounds.GetHeight(); + rMaxWidth = Max (rMaxWidth, aNativeContent.GetWidth()); } } return (rCheckHeight > rRadioHeight) ? rCheckHeight : rRadioHeight; @@ -1492,7 +1491,7 @@ void ToolbarMenu::implPaint( ToolbarMenuEntry* pThisOnly, bool bHighlighted ) aTmpPos.Y() = aOuterCheckRect.Top() + (aOuterCheckRect.GetHeight() - nCtrlHeight)/2; Rectangle aCheckRect( aTmpPos, Size( nCtrlHeight, nCtrlHeight ) ); - DrawNativeControl( CTRL_MENU_POPUP, nPart, Region( aCheckRect ), nState, ImplControlValue(), OUString() ); + DrawNativeControl( CTRL_MENU_POPUP, nPart, aCheckRect, nState, ImplControlValue(), OUString() ); } else if ( pEntry->mbChecked ) // by default do nothing for unchecked items { diff --git a/svtools/source/dialogs/addresstemplate.src b/svtools/source/dialogs/addresstemplate.src index 536f6d2a90b4..0e4845949dca 100644 --- a/svtools/source/dialogs/addresstemplate.src +++ b/svtools/source/dialogs/addresstemplate.src @@ -33,6 +33,7 @@ ModalDialog DLG_ADDRESSBOOKSOURCE { + HelpID = "svtools:ModalDialog:DLG_ADDRESSBOOKSOURCE"; SVLook = TRUE ; OutputSize = TRUE ; Size = MAP_APPFONT ( 300 , 88 + FIELD_ROW_HEIGHT * FIELD_PAIRS_VISIBLE ) ; @@ -58,6 +59,7 @@ ModalDialog DLG_ADDRESSBOOKSOURCE }; ComboBox CB_DATASOURCE { + HelpID = "svtools:ComboBox:DLG_ADDRESSBOOKSOURCE:CB_DATASOURCE"; SVLook = TRUE ; Pos = MAP_APPFONT ( 105, 13 ) ; Size = MAP_APPFONT ( 96, 55 ) ; @@ -67,6 +69,7 @@ ModalDialog DLG_ADDRESSBOOKSOURCE }; PushButton PB_ADMINISTATE_DATASOURCES { + HelpID = "svtools:PushButton:DLG_ADDRESSBOOKSOURCE:PB_ADMINISTATE_DATASOURCES"; Text [ en-US ] = "~Address Data Source..."; SVLook = TRUE ; Pos = MAP_APPFONT ( 204, 13 ) ; @@ -84,6 +87,7 @@ ModalDialog DLG_ADDRESSBOOKSOURCE }; ComboBox CB_TABLE { + HelpID = "svtools:ComboBox:DLG_ADDRESSBOOKSOURCE:CB_TABLE"; SVLook = TRUE ; Pos = MAP_APPFONT ( 105, 30 ) ; Size = MAP_APPFONT ( 96, 55 ) ; diff --git a/svtools/source/dialogs/colrdlg.src b/svtools/source/dialogs/colrdlg.src index ad9a5c1aa015..a93642b0bd05 100644 --- a/svtools/source/dialogs/colrdlg.src +++ b/svtools/source/dialogs/colrdlg.src @@ -29,6 +29,7 @@ #define DIFF 3 ModalDialog DLG_COLOR { + HelpID = "svtools:ModalDialog:DLG_COLOR"; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 260 , 165 + DIFF ) ; @@ -93,6 +94,7 @@ ModalDialog DLG_COLOR }; MetricField NUM_CYAN { + HelpID = "svtools:MetricField:DLG_COLOR:NUM_CYAN"; Border = TRUE ; Pos = MAP_APPFONT ( 42 , 109 + DIFF ) ; Size = MAP_APPFONT ( 26 , 12 ) ; @@ -106,6 +108,7 @@ ModalDialog DLG_COLOR }; MetricField NUM_MAGENTA { + HelpID = "svtools:MetricField:DLG_COLOR:NUM_MAGENTA"; Border = TRUE ; Pos = MAP_APPFONT ( 42 , 122 + DIFF ) ; Size = MAP_APPFONT ( 26 , 12 ) ; @@ -119,6 +122,7 @@ ModalDialog DLG_COLOR }; MetricField NUM_YELLOW { + HelpID = "svtools:MetricField:DLG_COLOR:NUM_YELLOW"; Border = TRUE ; Pos = MAP_APPFONT ( 42 , 135 + DIFF ) ; Size = MAP_APPFONT ( 26 , 12 ) ; @@ -132,6 +136,7 @@ ModalDialog DLG_COLOR }; MetricField NUM_KEY { + HelpID = "svtools:MetricField:DLG_COLOR:NUM_KEY"; Border = TRUE ; Pos = MAP_APPFONT ( 42 , 148 + DIFF ) ; Size = MAP_APPFONT ( 26 , 12 ) ; @@ -163,6 +168,7 @@ ModalDialog DLG_COLOR }; NumericField NUM_RED { + HelpID = "svtools:NumericField:DLG_COLOR:NUM_RED"; Border = TRUE ; Pos = MAP_APPFONT ( 106 , 122 + DIFF ) ; Size = MAP_APPFONT ( 26 , 12 ) ; @@ -174,6 +180,7 @@ ModalDialog DLG_COLOR }; NumericField NUM_GREEN { + HelpID = "svtools:NumericField:DLG_COLOR:NUM_GREEN"; Border = TRUE ; Pos = MAP_APPFONT ( 106 , 135 + DIFF ) ; Size = MAP_APPFONT ( 26 , 12 ) ; @@ -185,6 +192,7 @@ ModalDialog DLG_COLOR }; NumericField NUM_BLUE { + HelpID = "svtools:NumericField:DLG_COLOR:NUM_BLUE"; Border = TRUE ; Pos = MAP_APPFONT ( 106 , 148 + DIFF ) ; Size = MAP_APPFONT ( 26 , 12 ) ; @@ -202,6 +210,7 @@ ModalDialog DLG_COLOR }; NumericField NUM_HUE { + HelpID = "svtools:NumericField:DLG_COLOR:NUM_HUE"; Border = TRUE ; Pos = MAP_APPFONT ( 171 , 122 + DIFF ) ; Size = MAP_APPFONT ( 26 , 12 ) ; @@ -219,6 +228,7 @@ ModalDialog DLG_COLOR }; NumericField NUM_SATURATION { + HelpID = "svtools:NumericField:DLG_COLOR:NUM_SATURATION"; Border = TRUE ; Pos = MAP_APPFONT ( 171 , 135 + DIFF ) ; Size = MAP_APPFONT ( 26 , 12 ) ; @@ -236,6 +246,7 @@ ModalDialog DLG_COLOR }; NumericField NUM_LUMINANCE { + HelpID = "svtools:NumericField:DLG_COLOR:NUM_LUMINANCE"; Border = TRUE ; Pos = MAP_APPFONT ( 171 , 148 + DIFF ) ; Size = MAP_APPFONT ( 26 , 12 ) ; @@ -247,6 +258,7 @@ ModalDialog DLG_COLOR }; PushButton BTN_1 { + HelpID = "svtools:PushButton:DLG_COLOR:BTN_1"; Pos = MAP_APPFONT ( 80 , 109 ) ; Size = MAP_APPFONT ( 17 , 12 ) ; Text = "~<--" ; @@ -254,6 +266,7 @@ ModalDialog DLG_COLOR }; PushButton BTN_2 { + HelpID = "svtools:PushButton:DLG_COLOR:BTN_2"; Pos = MAP_APPFONT ( 100 , 109 ) ; Size = MAP_APPFONT ( 17 , 12 ) ; Text = "--~>" ; diff --git a/svtools/source/dialogs/filedlg2.cxx b/svtools/source/dialogs/filedlg2.cxx index 743e4ed3ad19..a2c68270ed81 100644 --- a/svtools/source/dialogs/filedlg2.cxx +++ b/svtools/source/dialogs/filedlg2.cxx @@ -65,9 +65,9 @@ DECLARE_LIST( UniStringList, UniString* ) // #define STD_BTN_WIDTH 90 // #define STD_BTN_HEIGHT 35 -#define INITCONTROL( p, ControlClass, nBits, aPos, aSize, aTitel, nHelpId ) \ +#define INITCONTROL( p, ControlClass, nBits, aPos, aSize, aTitel, rHelpId ) \ p = new ControlClass( GetPathDialog(), WinBits( nBits ) ); \ - p->SetHelpId( nHelpId ); \ + p->SetHelpId( rHelpId ); \ p->SetPosSizePixel( aPos, aSize ); \ p->SetText( aTitel ); \ p->Show(); @@ -223,10 +223,10 @@ void ImpPathDialog::InitControls() aPnt.X() = 2 * a6Siz.Width() + aEDSiz.Width(); aPnt.Y() = a6Siz.Height(); INITCONTROL( pOkBtn, PushButton, WB_DEFBUTTON, - aPnt, aBtnSiz, aOkStr, 0 ); + aPnt, aBtnSiz, aOkStr, "" ); aPnt.Y() += aBtnSiz.Height() + a3Siz.Height(); INITCONTROL( pCancelBtn, CancelButton, 0, - aPnt, aBtnSiz, aCancelStr, 0 ); + aPnt, aBtnSiz, aCancelStr, "" ); aPnt.Y() += aBtnSiz.Height() + a3Siz.Height(); INITCONTROL( pNewDirBtn, PushButton, WB_DEFBUTTON, aPnt, aBtnSiz, aNewDirStr, HID_FILEDLG_NEWDIR ); @@ -344,7 +344,7 @@ IMPL_LINK( ImpPathDialog, ClickHdl, Button*, pBtn ) if ( pBtn == pHomeBtn ) { ::rtl::OUString aHomeDir; - NAMESPACE_VOS( OSecurity ) aSecurity; + vos:: OSecurity aSecurity; if ( aSecurity.getHomeDir( aHomeDir ) ) { DirEntry aFile ( aHomeDir ); @@ -779,10 +779,10 @@ void ImpFileDialog::InitControls() const long nButtonStartX = 2*nW+20+15; INITCONTROL( pOkBtn, PushButton, WB_DEFBUTTON, Point(nButtonStartX, 10), Size(STD_BTN_WIDTH, STD_BTN_HEIGHT), - Button::GetStandardText( BUTTON_OK ), 0 ); + Button::GetStandardText( BUTTON_OK ), "" ); INITCONTROL( pCancelBtn, CancelButton, 0, Point(nButtonStartX, 45 ), Size(STD_BTN_WIDTH, STD_BTN_HEIGHT), - Button::GetStandardText( BUTTON_CANCEL ), 0 ); + Button::GetStandardText( BUTTON_CANCEL ), "" ); pLoadBtn = 0; diff --git a/svtools/source/dialogs/printdlg.cxx b/svtools/source/dialogs/printdlg.cxx index ab8b69fdcda1..779ff1da903b 100644 --- a/svtools/source/dialogs/printdlg.cxx +++ b/svtools/source/dialogs/printdlg.cxx @@ -38,8 +38,12 @@ #include <svtools/prnsetup.hxx> #include <svtools/printdlg.hxx> #include <svtools/svtdata.hxx> +<<<<<<< local #include <svtools/filedlg.hxx> #include "svl/pickerhelper.hxx" +======= +#include <filedlg.hxx> +>>>>>>> other #include <svtools/helpid.hrc> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp> diff --git a/svtools/source/dialogs/printdlg.src b/svtools/source/dialogs/printdlg.src index 405accc63344..80c6e465d49a 100644 --- a/svtools/source/dialogs/printdlg.src +++ b/svtools/source/dialogs/printdlg.src @@ -31,6 +31,7 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG { + HelpID = "svtools:ModalDialog:DLG_SVT_PRNDLG_PRINTDLG"; SVLook = TRUE ; OutputSize = TRUE ; Moveable = TRUE ; @@ -50,6 +51,7 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG }; ListBox LB_NAMES { + HelpID = "svtools:ListBox:DLG_SVT_PRNDLG_PRINTDLG:LB_NAMES"; Border = TRUE ; Pos = MAP_APPFONT ( 60 , 13 ) ; Size = MAP_APPFONT ( 130 , 80 ) ; @@ -58,6 +60,7 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG }; PushButton BTN_PROPERTIES { + HelpID = "svtools:PushButton:DLG_SVT_PRNDLG_PRINTDLG:BTN_PROPERTIES"; Pos = MAP_APPFONT ( 193 , 12 ) ; Size = MAP_APPFONT ( 60 , 14 ) ; Text [ en-US ] = "Propert~ies..." ; @@ -114,12 +117,14 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG }; Edit EDT_FAXNO { + HelpID = "svtools:Edit:DLG_SVT_PRNDLG_PRINTDLG:EDT_FAXNO"; Border = TRUE; Pos = MAP_APPFONT ( 60 , 73 ); Size = MAP_APPFONT ( 188 , 12 ); }; CheckBox CBX_FILEPRINT { + HelpID = "svtools:CheckBox:DLG_SVT_PRNDLG_PRINTDLG:CBX_FILEPRINT"; Pos = MAP_APPFONT ( 12 , 73 ) ; Size = MAP_APPFONT ( 75 , 10 ) ; Text [ en-US ] = "Print to file" ; @@ -132,6 +137,7 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG /*!!! PushButton BTN_BROWSE { + HelpID = "svtools:PushButton:DLG_SVT_PRNDLG_PRINTDLG:BTN_BROWSE"; Pos = MAP_APPFONT ( 234 , 75 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; Text = "~..." ; @@ -146,18 +152,21 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG }; RadioButton RBT_ALL_SHEETS { + HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_ALL_SHEETS"; Pos = MAP_APPFONT ( 12 , 102 ) ; Size = MAP_APPFONT ( 105 , 10 ) ; Text [ en-US ] = "All sheets" ; }; RadioButton RBT_SELECTED_SHEETS { + HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_SELECTED_SHEETS"; Pos = MAP_APPFONT ( 12 , 115 ) ; Size = MAP_APPFONT ( 105 , 10 ) ; Text [ en-US ] = "Selected sheets" ; }; RadioButton RBT_SELECTED_CELLS { + HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_SELECTED_CELLS"; Pos = MAP_APPFONT ( 12 , 128 ) ; Size = MAP_APPFONT ( 105 , 10 ) ; Text [ en-US ] = "Selected cells" ; @@ -170,24 +179,28 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG }; RadioButton RBT_ALL { + HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_ALL"; Pos = MAP_APPFONT ( 12 , 152 ) ; Size = MAP_APPFONT ( 105 , 10 ) ; Text [ en-US ] = "All pages" ; }; RadioButton RBT_PAGES { + HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_PAGES"; Pos = MAP_APPFONT ( 12 , 165 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; Text [ en-US ] = "Pages" ; }; Edit EDT_PAGES { + HelpID = "svtools:Edit:DLG_SVT_PRNDLG_PRINTDLG:EDT_PAGES"; Border = TRUE ; Pos = MAP_APPFONT ( 65 , 164 ) ; Size = MAP_APPFONT ( 52 , 12 ) ; }; RadioButton RBT_SELECTION { + HelpID = "svtools:RadioButton:DLG_SVT_PRNDLG_PRINTDLG:RBT_SELECTION"; Hide = TRUE ; Pos = MAP_APPFONT ( 12 , 179 ) ; Size = MAP_APPFONT ( 105 , 10 ) ; @@ -213,6 +226,7 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG }; NumericField NUM_COPIES { + HelpID = "svtools:NumericField:DLG_SVT_PRNDLG_PRINTDLG:NUM_COPIES"; Border = TRUE ; Pos = MAP_APPFONT ( 201 , 102 ) ; Size = MAP_APPFONT ( 33 , 12 ) ; @@ -226,6 +240,7 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG }; CheckBox CBX_COLLATE { + HelpID = "svtools:CheckBox:DLG_SVT_PRNDLG_PRINTDLG:CBX_COLLATE"; Pos = MAP_APPFONT ( 201 , 123 ) ; Size = MAP_APPFONT ( 60 , 10 ) ; Text [ en-US ] = "Co~llate" ; @@ -249,6 +264,7 @@ ModalDialog DLG_SVT_PRNDLG_PRINTDLG }; PushButton BTN_OPTIONS { + HelpID = "svtools:PushButton:DLG_SVT_PRNDLG_PRINTDLG:BTN_OPTIONS"; Hide = TRUE ; Pos = MAP_APPFONT ( 6 , 190 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; diff --git a/svtools/source/dialogs/prnsetup.src b/svtools/source/dialogs/prnsetup.src index 1443a35e0f39..afdf7d56864e 100644 --- a/svtools/source/dialogs/prnsetup.src +++ b/svtools/source/dialogs/prnsetup.src @@ -138,6 +138,7 @@ String STR_SVT_PRNDLG_JOBCOUNT ModalDialog DLG_SVT_PRNDLG_PRNSETUPDLG { + HelpID = "svtools:ModalDialog:DLG_SVT_PRNDLG_PRNSETUPDLG"; OutputSize = TRUE ; SVLook = TRUE ; Moveable = TRUE ; @@ -157,6 +158,7 @@ ModalDialog DLG_SVT_PRNDLG_PRNSETUPDLG }; ListBox LB_NAMES { + HelpID = "svtools:ListBox:DLG_SVT_PRNDLG_PRNSETUPDLG:LB_NAMES"; Border = TRUE ; Pos = MAP_APPFONT ( 60 , 12 ) ; Size = MAP_APPFONT ( 125 , 80 ) ; @@ -165,6 +167,7 @@ ModalDialog DLG_SVT_PRNDLG_PRNSETUPDLG }; PushButton BTN_PROPERTIES { + HelpID = "svtools:PushButton:DLG_SVT_PRNDLG_PRNSETUPDLG:BTN_PROPERTIES"; Pos = MAP_APPFONT ( 188 , 12 ) ; Size = MAP_APPFONT ( 60 , 14 ) ; Text [ en-US ] = "Propert~ies..." ; @@ -220,6 +223,7 @@ ModalDialog DLG_SVT_PRNDLG_PRNSETUPDLG }; PushButton BTN_OPTIONS { + HelpID = "svtools:PushButton:DLG_SVT_PRNDLG_PRNSETUPDLG:BTN_OPTIONS"; Pos = MAP_APPFONT ( 5 , 84 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Options..." ; diff --git a/svtools/source/dialogs/roadmapwizard.cxx b/svtools/source/dialogs/roadmapwizard.cxx index 5f99358132f1..cdf2eef32fdc 100644 --- a/svtools/source/dialogs/roadmapwizard.cxx +++ b/svtools/source/dialogs/roadmapwizard.cxx @@ -239,15 +239,15 @@ namespace svt } //-------------------------------------------------------------------- - void RoadmapWizard::SetRoadmapSmartHelpId( const SmartId& _rId, SmartIdUpdateMode _aMode ) + void RoadmapWizard::SetRoadmapHelpId( const rtl::OString& _rId ) { - m_pImpl->pRoadmap->SetSmartHelpId( _rId, _aMode ); + m_pImpl->pRoadmap->SetHelpId( _rId ); } //-------------------------------------------------------------------- - SmartId RoadmapWizard::GetRoadmapSmartHelpId() const + const rtl::OString& RoadmapWizard::GetRoadmapHelpId() const { - return m_pImpl->pRoadmap->GetSmartHelpId(); + return m_pImpl->pRoadmap->GetHelpId(); } //-------------------------------------------------------------------- diff --git a/svtools/source/dialogs/wizardmachine.cxx b/svtools/source/dialogs/wizardmachine.cxx index 2053da80019d..41e759eda43b 100644 --- a/svtools/source/dialogs/wizardmachine.cxx +++ b/svtools/source/dialogs/wizardmachine.cxx @@ -197,7 +197,7 @@ namespace svt if (_nButtonFlags & WZB_PREVIOUS) { m_pPrevPage = new PushButton(this, WB_TABSTOP); - m_pPrevPage->SetSmartHelpId( SmartId(HID_WIZARD_PREVIOUS) ); + m_pPrevPage->SetHelpId( HID_WIZARD_PREVIOUS ); m_pPrevPage->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) ); m_pPrevPage->SetText(String(SvtResId(STR_WIZDLG_PREVIOUS))); m_pPrevPage->Show(); @@ -214,7 +214,7 @@ namespace svt if (_nButtonFlags & WZB_NEXT) { m_pNextPage = new PushButton(this, WB_TABSTOP); - m_pNextPage->SetSmartHelpId( SmartId(HID_WIZARD_NEXT) ); + m_pNextPage->SetHelpId( HID_WIZARD_NEXT ); m_pNextPage->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) ); m_pNextPage->SetText(String(SvtResId(STR_WIZDLG_NEXT))); m_pNextPage->Show(); diff --git a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx index 038930ef80ee..1c4eeeff1bbf 100644 --- a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx +++ b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx @@ -36,9 +36,7 @@ #include <osl/module.hxx> #include <svl/solar.hrc> #include <svtools/fltcall.hxx> -#include "dlgexpor.hxx" -#include "dlgejpg.hxx" -#include "dlgepng.hxx" +#include "exportdialog.hxx" #include <uno/mapping.hxx> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/document/XViewDataSupplier.hpp> @@ -49,12 +47,6 @@ #include <unotools/syslocale.hxx> #include "vcl/svapp.hxx" -#if defined WIN || (defined OS2 && !defined ICC) -#define EXPDLG_FUNCTION_NAME "_DoExportDialog" -#else -#define EXPDLG_FUNCTION_NAME "DoExportDialog" -#endif - using namespace ::rtl; using namespace ::com::sun::star; @@ -93,9 +85,10 @@ uno::Sequence< OUString > SAL_CALL SvFilterOptionsDialog_getSupportedServiceName // ----------------------------------------------------------------------------- -SvFilterOptionsDialog::SvFilterOptionsDialog( const uno::Reference< lang::XMultiServiceFactory > & xMgr ) : - rxMgr ( xMgr ), - eFieldUnit ( FUNIT_CM ) +SvFilterOptionsDialog::SvFilterOptionsDialog( const uno::Reference< lang::XMultiServiceFactory > xMgr ) : + mxMgr ( xMgr ), + meFieldUnit ( FUNIT_CM ), + mbExportSelection ( sal_False ) { } @@ -148,18 +141,18 @@ uno::Sequence< beans::PropertyValue > SvFilterOptionsDialog::getPropertyValues() throw ( uno::RuntimeException ) { sal_Int32 i, nCount; - for ( i = 0, nCount = aMediaDescriptor.getLength(); i < nCount; i++ ) + for ( i = 0, nCount = maMediaDescriptor.getLength(); i < nCount; i++ ) { - if ( aMediaDescriptor[ i ].Name.equalsAscii( "FilterData" ) ) + if ( maMediaDescriptor[ i ].Name.equalsAscii( "FilterData" ) ) break; } if ( i == nCount ) - aMediaDescriptor.realloc( ++nCount ); + maMediaDescriptor.realloc( ++nCount ); // the "FilterData" Property is an Any that will contain our PropertySequence of Values - aMediaDescriptor[ i ].Name = String( RTL_CONSTASCII_USTRINGPARAM( "FilterData" ) ); - aMediaDescriptor[ i ].Value <<= aFilterDataSequence; - return aMediaDescriptor; + maMediaDescriptor[ i ].Name = String( RTL_CONSTASCII_USTRINGPARAM( "FilterData" ) ); + maMediaDescriptor[ i ].Value <<= maFilterDataSequence; + return maMediaDescriptor; } void SvFilterOptionsDialog::setPropertyValues( const uno::Sequence< beans::PropertyValue > & aProps ) @@ -167,15 +160,18 @@ void SvFilterOptionsDialog::setPropertyValues( const uno::Sequence< beans::Prope lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException ) { - aMediaDescriptor = aProps; + maMediaDescriptor = aProps; sal_Int32 i, nCount; - for ( i = 0, nCount = aMediaDescriptor.getLength(); i < nCount; i++ ) + for ( i = 0, nCount = maMediaDescriptor.getLength(); i < nCount; i++ ) { - if ( aMediaDescriptor[ i ].Name.equalsAscii( "FilterData" ) ) + if ( maMediaDescriptor[ i ].Name.equalsAscii( "FilterData" ) ) { - aMediaDescriptor[ i ].Value >>= aFilterDataSequence; - break; + maMediaDescriptor[ i ].Value >>= maFilterDataSequence; + } + else if ( maMediaDescriptor[ i ].Name.equalsAscii( "SelectionOnly" ) ) + { + maMediaDescriptor[ i ].Value >>= mbExportSelection; } } } @@ -184,7 +180,7 @@ void SvFilterOptionsDialog::setPropertyValues( const uno::Sequence< beans::Prope void SvFilterOptionsDialog::setTitle( const OUString& aTitle ) throw ( uno::RuntimeException ) { - aDialogTitle = aTitle; + maDialogTitle = aTitle; } sal_Int16 SvFilterOptionsDialog::execute() @@ -194,13 +190,13 @@ sal_Int16 SvFilterOptionsDialog::execute() String aFilterNameStr( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ) ); String aInternalFilterName; - sal_Int32 j, nCount = aMediaDescriptor.getLength(); + sal_Int32 j, nCount = maMediaDescriptor.getLength(); for ( j = 0; j < nCount; j++ ) { - if ( aMediaDescriptor[ j ].Name.equals( aFilterNameStr ) ) + if ( maMediaDescriptor[ j ].Name.equals( aFilterNameStr ) ) { OUString aStr; - aMediaDescriptor[ j ].Value >>= aStr; + maMediaDescriptor[ j ].Value >>= aStr; aInternalFilterName = aStr; aInternalFilterName.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "draw_" ) ), String(), 0 ); aInternalFilterName.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "impress_" ) ), String(), 0 ); @@ -219,79 +215,24 @@ sal_Int16 SvFilterOptionsDialog::execute() } if ( nFormat < nFilterCount ) { - FltCallDialogParameter aFltCallDlgPara( Application::GetDefDialogParent(), NULL, eFieldUnit ); - aFltCallDlgPara.aFilterData = aFilterDataSequence; - - String aFilterName( aGraphicFilter.pConfig->GetExportFilterName( nFormat ) ); - if ( aGraphicFilter.pConfig->IsExportInternalFilter( nFormat ) ) - { - // Export-Dialog fuer Bitmap's, SVM's und WMF's - if( ( aFilterName.EqualsIgnoreCaseAscii( EXP_BMP ) ) || - ( aFilterName.EqualsIgnoreCaseAscii( EXP_SVMETAFILE ) ) || - ( aFilterName.EqualsIgnoreCaseAscii( EXP_WMF ) ) || - ( aFilterName.EqualsIgnoreCaseAscii( EXP_EMF ) ) || - ( aFilterName.EqualsIgnoreCaseAscii( EXP_JPEG ) )|| - ( aFilterName.EqualsIgnoreCaseAscii( EXP_PNG ) ) ) - { - ByteString aResMgrName( "svt", 3 ); - ResMgr* pResMgr; - - pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ); - aFltCallDlgPara.pResMgr = pResMgr; - // JPEG-Dialog - if( aFilterName.EqualsIgnoreCaseAscii( EXP_JPEG ) ) - { - if ( DlgExportEJPG( aFltCallDlgPara ).Execute() == RET_OK ) - nRet = ui::dialogs::ExecutableDialogResults::OK; - } - else if ( aFilterName.EqualsIgnoreCaseAscii( EXP_PNG ) ) - { - if ( DlgExportEPNG( aFltCallDlgPara ).Execute() == RET_OK ) - nRet = ui::dialogs::ExecutableDialogResults::OK; - } - else if( aFilterName.EqualsIgnoreCaseAscii( EXP_BMP ) ) - { - // Fuer Vektorformate nehmen wir den Vektor-Dialog - aFltCallDlgPara.aFilterExt = aGraphicFilter.pConfig->GetExportFormatShortName( nFormat ); - if ( DlgExportPix( aFltCallDlgPara ).Execute() == RET_OK ) - nRet = ui::dialogs::ExecutableDialogResults::OK; - } - else - { - aFltCallDlgPara.aFilterExt = aGraphicFilter.pConfig->GetExportFormatShortName( nFormat ); - if ( DlgExportVec( aFltCallDlgPara ).Execute() == RET_OK ) - nRet = ui::dialogs::ExecutableDialogResults::OK; - } - delete pResMgr; - } - } - else // ladbare Filter - { - xub_StrLen i, nTokenCount = aGraphicFilter.aFilterPath.GetTokenCount( ';' ); - for ( i = 0; i < nTokenCount; i++ ) - { - - OUString aPathURL; - - ::osl::FileBase::getFileURLFromSystemPath( aGraphicFilter.aFilterPath.GetToken( i ), aPathURL ); - aPathURL += String( '/' ); - - OUString aSystemPath; - ::osl::FileBase::getSystemPathFromFileURL( aPathURL, aSystemPath ); - aSystemPath += OUString( aFilterName ); - - osl::Module aLibrary( aSystemPath ); - PFilterDlgCall pFunc = (PFilterDlgCall) aLibrary.getFunctionSymbol( UniString::CreateFromAscii( EXPDLG_FUNCTION_NAME ) ); - // Dialog in DLL ausfuehren - if( pFunc ) - { - if ( (*pFunc)( aFltCallDlgPara ) ) - nRet = ui::dialogs::ExecutableDialogResults::OK; - } - } - } + FltCallDialogParameter aFltCallDlgPara( Application::GetDefDialogParent(), NULL, meFieldUnit ); + aFltCallDlgPara.aFilterData = maFilterDataSequence; + + ByteString aResMgrName( "svt", 3 ); + ResMgr* pResMgr; + + pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ); + aFltCallDlgPara.pResMgr = pResMgr; + + aFltCallDlgPara.aFilterExt = aGraphicFilter.pConfig->GetExportFormatShortName( nFormat ); + sal_Bool bIsPixelFormat( aGraphicFilter.pConfig->IsExportPixelFormat( nFormat ) ); + if ( ExportDialog( aFltCallDlgPara, mxMgr, mxSourceDocument, mbExportSelection, bIsPixelFormat ).Execute() == RET_OK ) + nRet = ui::dialogs::ExecutableDialogResults::OK; + + delete pResMgr; + // taking the out parameter from the dialog - aFilterDataSequence = aFltCallDlgPara.aFilterData; + maFilterDataSequence = aFltCallDlgPara.aFilterData; } } return nRet; @@ -301,6 +242,8 @@ sal_Int16 SvFilterOptionsDialog::execute() void SvFilterOptionsDialog::setSourceDocument( const uno::Reference< lang::XComponent >& xDoc ) throw ( lang::IllegalArgumentException, uno::RuntimeException ) { + mxSourceDocument = xDoc; + // try to set the corresponding metric unit String aConfigPath; uno::Reference< lang::XServiceInfo > xServiceInfo @@ -320,7 +263,7 @@ void SvFilterOptionsDialog::setSourceDocument( const uno::Reference< lang::XComp aPropertyName = String( RTL_CONSTASCII_USTRINGPARAM( "Metric" ) ); else aPropertyName = String( RTL_CONSTASCII_USTRINGPARAM( "NonMetric" ) ); - eFieldUnit = (FieldUnit)aConfigItem.ReadInt32( aPropertyName, FUNIT_CM ); + meFieldUnit = (FieldUnit)aConfigItem.ReadInt32( aPropertyName, FUNIT_CM ); } } } diff --git a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx index a55fc4c84520..16592bac8df7 100644 --- a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx +++ b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.hxx @@ -46,18 +46,22 @@ class SvFilterOptionsDialog : public cppu::WeakImplHelper5 com::sun::star::lang::XServiceInfo > { - const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > & - rxMgr; + const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > + mxMgr; com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > - aMediaDescriptor; + maMediaDescriptor; com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > - aFilterDataSequence; - rtl::OUString aDialogTitle; - FieldUnit eFieldUnit; + maFilterDataSequence; + com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > + mxSourceDocument; + + rtl::OUString maDialogTitle; + FieldUnit meFieldUnit; + sal_Bool mbExportSelection; public: - SvFilterOptionsDialog( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB ); + SvFilterOptionsDialog( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > _rxORB ); ~SvFilterOptionsDialog(); // XInterface diff --git a/svtools/source/filter.vcl/filter/dlgejpg.cxx b/svtools/source/filter.vcl/filter/dlgejpg.cxx deleted file mode 100644 index 377697023de3..000000000000 --- a/svtools/source/filter.vcl/filter/dlgejpg.cxx +++ /dev/null @@ -1,96 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svtools.hxx" -#include "dlgejpg.hxx" -#include "dlgejpg.hrc" -#include "strings.hrc" -#include <svtools/FilterConfigItem.hxx> - -#define KEY_QUALITY "Quality" -#define KEY_GRAYSCALES "ColorMode" - -/************************************************************************* -|* -|* Ctor -|* -\************************************************************************/ - -DlgExportEJPG::DlgExportEJPG( FltCallDialogParameter& rPara ) : - ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_JPG, *rPara.pResMgr ) ), - rFltCallPara ( rPara ), - aFiDescr ( this, ResId( FI_DESCR, *rPara.pResMgr ) ), - aNumFldQuality ( this, ResId( NUM_FLD_QUALITY, *rPara.pResMgr ) ), - aGrpQuality ( this, ResId( GRP_QUALITY, *rPara.pResMgr ) ), - aRbGray ( this, ResId( RB_GRAY, *rPara.pResMgr ) ), - aRbRGB ( this, ResId( RB_RGB, *rPara.pResMgr ) ), - aGrpColors ( this, ResId( GRP_COLORS, *rPara.pResMgr ) ), - aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ), - aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ), - aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ) -{ - FreeResource(); - String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/JPG" ) ); - pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData ); - - // reading filter options - sal_Int32 nQuality = pConfigItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( KEY_QUALITY ) ), 75 ); - sal_Int32 nColorMode = pConfigItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( KEY_GRAYSCALES ) ), 0 ); - aNumFldQuality.SetValue( nQuality ); - - if ( nColorMode ) - aRbGray.Check( sal_True ); - else - aRbRGB.Check( sal_True ); - - aBtnOK.SetClickHdl( LINK( this, DlgExportEJPG, OK ) ); -} - - -/************************************************************************* -|* -|* Speichert eingestellte Werte in ini-Datei -|* -\************************************************************************/ - -IMPL_LINK( DlgExportEJPG, OK, void *, EMPTYARG ) -{ - // Config-Parameter schreiben - pConfigItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( KEY_QUALITY ) ), (sal_Int32)aNumFldQuality.GetValue() ); - pConfigItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( KEY_GRAYSCALES ) ), aRbGray.IsChecked() ? 1 : 0 ); - rFltCallPara.aFilterData = pConfigItem->GetFilterData(); - EndDialog( RET_OK ); - return 0; -} - -DlgExportEJPG::~DlgExportEJPG() -{ - delete pConfigItem; -} - - diff --git a/svtools/source/filter.vcl/filter/dlgejpg.hrc b/svtools/source/filter.vcl/filter/dlgejpg.hrc deleted file mode 100644 index 90a3c1d162be..000000000000 --- a/svtools/source/filter.vcl/filter/dlgejpg.hrc +++ /dev/null @@ -1,39 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include <svtools/svtools.hrc> - -#define BTN_OK 1 -#define BTN_CANCEL 1 -#define BTN_HELP 1 -#define FI_DESCR 1 -#define NUM_FLD_QUALITY 1 -#define GRP_QUALITY 1 -#define GRP_COLORS 2 -#define RB_GRAY 1 -#define RB_RGB 2 - - diff --git a/svtools/source/filter.vcl/filter/dlgejpg.hxx b/svtools/source/filter.vcl/filter/dlgejpg.hxx deleted file mode 100644 index d80682574a54..000000000000 --- a/svtools/source/filter.vcl/filter/dlgejpg.hxx +++ /dev/null @@ -1,72 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#ifndef _DLGEJPG_HXX_ -#define _DLGEJPG_HXX_ - -#include <vcl/dialog.hxx> -#include <vcl/button.hxx> -#include <vcl/fixed.hxx> -#include <vcl/field.hxx> -#include <vcl/lstbox.hxx> -#include <vcl/msgbox.hxx> -#include <svtools/stdctrl.hxx> -#include <svtools/fltcall.hxx> - -/************************************************************************* -|* -|* Dialog zum Einstellen von Filteroptionen -|* -\************************************************************************/ -class FilterConfigItem; -class DlgExportEJPG : public ModalDialog -{ -private: - - FltCallDialogParameter& rFltCallPara; - - FixedInfo aFiDescr; - NumericField aNumFldQuality; - FixedLine aGrpQuality; - RadioButton aRbGray; - RadioButton aRbRGB; - FixedLine aGrpColors; - OKButton aBtnOK; - CancelButton aBtnCancel; - HelpButton aBtnHelp; - FilterConfigItem* pConfigItem; - - DECL_LINK( OK, void * ); - -public: - DlgExportEJPG( FltCallDialogParameter& rDlgPara ); - ~DlgExportEJPG(); -}; - -#endif // _DLGEJPG_HXX_ - diff --git a/svtools/source/filter.vcl/filter/dlgejpg.src b/svtools/source/filter.vcl/filter/dlgejpg.src deleted file mode 100644 index fd224f22c409..000000000000 --- a/svtools/source/filter.vcl/filter/dlgejpg.src +++ /dev/null @@ -1,136 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "dlgejpg.hrc" -ModalDialog DLG_EXPORT_JPG -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 159 , 92 ) ; - Text [ en-US ] = "JPEG Options" ; - Moveable = TRUE ; - Closeable = TRUE ; - OKButton BTN_OK - { - Pos = MAP_APPFONT ( 103 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 103 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BTN_HELP - { - Pos = MAP_APPFONT ( 103 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - FixedLine GRP_QUALITY - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 90 , 8 ) ; - Text [ en-US ] = "Quality" ; - }; - FixedText FI_DESCR - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 81 , 16 ) ; - Text [ en-US ] = "1: min. quality\n100: max. quality" ; - }; - NumericField NUM_FLD_QUALITY - { - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 33 ) ; - Size = MAP_APPFONT ( 50 , 12 ) ; - TabStop = TRUE ; - Spin = TRUE ; - Minimum = 1; - Maximum = 100 ; - StrictFormat = TRUE ; - Last = 100 ; - Repeat = TRUE ; - }; - FixedLine GRP_COLORS - { - Pos = MAP_APPFONT ( 6 , 51 ) ; - Size = MAP_APPFONT ( 90 , 8 ) ; - Text [ en-US ] = "Color resolution" ; - }; - RadioButton RB_GRAY - { - Pos = MAP_APPFONT ( 12 , 62 ) ; - Size = MAP_APPFONT ( 81 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Grayscale" ; - }; - RadioButton RB_RGB - { - Pos = MAP_APPFONT ( 12 , 76 ) ; - Size = MAP_APPFONT ( 81 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "True Colors" ; - }; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/svtools/source/filter.vcl/filter/dlgepng.cxx b/svtools/source/filter.vcl/filter/dlgepng.cxx deleted file mode 100644 index bd551e9a4bda..000000000000 --- a/svtools/source/filter.vcl/filter/dlgepng.cxx +++ /dev/null @@ -1,90 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svtools.hxx" -#include <tools/ref.hxx> -#include <vcl/msgbox.hxx> -#include "dlgepng.hxx" -#include "dlgepng.hrc" - -using namespace ::rtl; -using namespace ::com::sun::star::uno; - -/************************************************************************* -|* -|* Ctor -|* -\************************************************************************/ - -DlgExportEPNG::DlgExportEPNG( FltCallDialogParameter& rPara ) : - ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_EPNG, *rPara.pResMgr ) ), - FilterConfigItem ( OUString( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/PNG" ) ), &rPara.aFilterData ), - rFltCallPara ( rPara ), - aGrpCompression ( this, ResId( GRP_COMPRESSION, *rPara.pResMgr ) ), - aFiCompression ( this, ResId( FI_COMPRESSION, *rPara.pResMgr ) ), - aNumCompression ( this, ResId( NUM_COMPRESSION, *rPara.pResMgr ) ), - aCbxInterlaced ( this, ResId( CBX_INTERLACED, *rPara.pResMgr ) ), - aBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ), - aBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ), - aBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ), - pMgr ( rPara.pResMgr ) -{ - FreeResource(); - - // Config-Parameter lesen - sal_Int32 nCompression = ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Compression" ) ), 6 ); - if ( ( nCompression < 0 ) || ( nCompression > 9 ) ) - nCompression = 6; - aNumCompression.SetValue( nCompression ); - - sal_Int32 nInterlaced = ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), 0 ); - sal_Bool bInterlaced = nInterlaced != 0; - aCbxInterlaced.Check( bInterlaced ); - - aBtnOK.SetClickHdl( LINK( this, DlgExportEPNG, OK ) ); -} - -/************************************************************************* -|* -|* Speichert eingestellte Werte in ini-Datei -|* -\************************************************************************/ - -IMPL_LINK( DlgExportEPNG, OK, void *, EMPTYARG ) -{ - // Config-Parameter schreiben - WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Compression" ) ), static_cast<sal_Int32>(aNumCompression.GetValue()) ); - sal_Int32 nInterlace = 0; - if ( aCbxInterlaced.IsChecked() ) - nInterlace++; - WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), nInterlace ); - rFltCallPara.aFilterData = GetFilterData(); - EndDialog( RET_OK ); - - return 0; -} diff --git a/svtools/source/filter.vcl/filter/dlgepng.hrc b/svtools/source/filter.vcl/filter/dlgepng.hrc deleted file mode 100644 index b3ffaab3ab1e..000000000000 --- a/svtools/source/filter.vcl/filter/dlgepng.hrc +++ /dev/null @@ -1,35 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include <svtools/svtools.hrc> - -#define BTN_OK 1 -#define BTN_CANCEL 1 -#define BTN_HELP 1 -#define GRP_COMPRESSION 1 -#define FI_COMPRESSION 1 -#define NUM_COMPRESSION 1 -#define CBX_INTERLACED 1 diff --git a/svtools/source/filter.vcl/filter/dlgepng.hxx b/svtools/source/filter.vcl/filter/dlgepng.hxx deleted file mode 100644 index 469985afee59..000000000000 --- a/svtools/source/filter.vcl/filter/dlgepng.hxx +++ /dev/null @@ -1,71 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#ifndef _DLGEPNG_HXX_ -#define _DLGEPNG_HXX_ -#include <svtools/fltcall.hxx> -#include <vcl/dialog.hxx> -#include <vcl/button.hxx> -#include <vcl/fixed.hxx> -#include <vcl/field.hxx> -#include <svtools/stdctrl.hxx> -#include <svtools/FilterConfigItem.hxx> - - -/************************************************************************* -|* -|* Dialog zum Einstellen von Filteroptionen -|* -\************************************************************************/ - -class ResMgr; - -class DlgExportEPNG : public ModalDialog, FilterConfigItem -{ - - private: - - FltCallDialogParameter& rFltCallPara; - - FixedLine aGrpCompression; - FixedInfo aFiCompression; - NumericField aNumCompression; - CheckBox aCbxInterlaced; - OKButton aBtnOK; - CancelButton aBtnCancel; - HelpButton aBtnHelp; - ResMgr* pMgr; - - DECL_LINK( OK, void * ); - - public: - - DlgExportEPNG( FltCallDialogParameter& rPara ); -}; - -#endif // _DLGEPNG_HXX_ diff --git a/svtools/source/filter.vcl/filter/dlgepng.src b/svtools/source/filter.vcl/filter/dlgepng.src deleted file mode 100644 index aa778842dc48..000000000000 --- a/svtools/source/filter.vcl/filter/dlgepng.src +++ /dev/null @@ -1,119 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "dlgepng.hrc" -ModalDialog DLG_EXPORT_EPNG -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 169 , 64 ) ; - Moveable = TRUE ; - Closeable = TRUE ; - Text [ en-US ] = "PNG Options" ; - OKButton BTN_OK - { - Pos = MAP_APPFONT ( 113 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 113 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BTN_HELP - { - Pos = MAP_APPFONT ( 113 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - FixedLine GRP_COMPRESSION - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 100 , 8 ) ; - Text[ en-US ] = "Mode"; - }; - FixedText FI_COMPRESSION - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 80 , 8 ) ; - Text[ en-US ] = "~Compression 0..9"; - }; - NumericField NUM_COMPRESSION - { - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 25 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Spin = TRUE ; - Minimum = 0 ; - Maximum = 9 ; - First = 0 ; - Last = 9 ; - StrictFormat = TRUE ; - Repeat = TRUE ; - }; - CheckBox CBX_INTERLACED - { - Pos = MAP_APPFONT ( 12 , 43 ) ; - Size = MAP_APPFONT ( 80 , 12 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Interlaced" ; - }; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/svtools/source/filter.vcl/filter/dlgexpor.cxx b/svtools/source/filter.vcl/filter/dlgexpor.cxx deleted file mode 100644 index b4b7c0fc949d..000000000000 --- a/svtools/source/filter.vcl/filter/dlgexpor.cxx +++ /dev/null @@ -1,442 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svtools.hxx" - -#ifndef GCC -# pragma hdrstop -#endif - -#include <tools/ref.hxx> -#include <svtools/FilterConfigItem.hxx> -#include <com/sun/star/awt/Size.hpp> -#include <vcl/msgbox.hxx> -#include "dlgexpor.hxx" -#include "dlgexpor.hrc" -#include "strings.hrc" - -/************************************************************************* -|* -|* Ctor -|* -\************************************************************************/ - -DlgExportPix::DlgExportPix( FltCallDialogParameter& rPara ) : - ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_PIX, *rPara.pResMgr ) ), - rFltCallPara ( rPara ), - aBtnOK ( this, ResId( BTN_OK_PIX, *rPara.pResMgr ) ), - aBtnCancel ( this, ResId( BTN_CANCEL_PIX, *rPara.pResMgr ) ), - aBtnHelp ( this, ResId( BTN_HELP_PIX, *rPara.pResMgr ) ), - aLbColors ( this, ResId( LB_COLORS, *rPara.pResMgr ) ), - aCbxRLE ( this, ResId( CBX_RLE, *rPara.pResMgr ) ), - aGrpColors ( this, ResId( GRP_COLORS, *rPara.pResMgr ) ), - aRbOriginal ( this, ResId( RB_ORIGINAL_PIX, *rPara.pResMgr ) ), - aRbRes ( this, ResId( RB_RES_PIX, *rPara.pResMgr ) ), - aRbSize ( this, ResId( RB_SIZE_PIX, *rPara.pResMgr ) ), - aFtSizeX ( this, ResId( FT_SIZEX_PIX, *rPara.pResMgr ) ), - aMtfSizeX ( this, ResId( MTF_SIZEX_PIX, *rPara.pResMgr ) ), - aFtSizeY ( this, ResId( FT_SIZEY_PIX, *rPara.pResMgr ) ), - aMtfSizeY ( this, ResId( MTF_SIZEY_PIX, *rPara.pResMgr ) ), - aGrpMode ( this, ResId( GRP_MODE_PIX, *rPara.pResMgr ) ), - aCbbRes ( this, ResId( CBB_RES_PIX, *rPara.pResMgr ) ), - pMgr ( rPara.pResMgr ), - aExt ( rPara.aFilterExt ) -{ - aExt.ToUpperAscii(); - String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/" ) ); - aFilterConfigPath.Append( aExt ); - pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData ); - - String aTitle( aExt ); - FreeResource(); - - aBtnOK.SetClickHdl( LINK( this, DlgExportPix, OK ) ); - aRbOriginal.SetClickHdl( LINK( this, DlgExportPix, ClickRbOriginal ) ); - aRbRes.SetClickHdl( LINK( this, DlgExportPix, ClickRbRes ) ); - aRbSize.SetClickHdl( LINK( this, DlgExportPix, ClickRbSize ) ); - aLbColors.SetSelectHdl( LINK( this, DlgExportPix, SelectLbColors ) ); - - aTitle.ToUpperAscii(); - aTitle += String( ResId( EXPORT_DIALOG_TITLE, *pMgr ) ); - SetText( aTitle ); - - // Config-Parameter lesen - sal_Int32 nColors = pConfigItem->ReadInt32( String( ResId( KEY_COLORS, *pMgr ) ), 0 ); - sal_Int32 nMode = pConfigItem->ReadInt32( String( ResId( KEY_MODE, *pMgr ) ), 0 ); - sal_Int32 nRes = pConfigItem->ReadInt32( String( ResId( KEY_RES, *pMgr ) ), 75 ); - sal_Bool bRleCoding = pConfigItem->ReadBool( String( ResId( KEY_RLE_CODING, *pMgr ) ), sal_True ); - - aLbColors.SelectEntryPos( Min( (sal_uInt16) 7, (sal_uInt16)nColors ) ); - - String aStrRes( String::CreateFromInt32( nRes ) ); - aStrRes.Append( String( RTL_CONSTASCII_USTRINGPARAM( " DPI" ) ) ); - aCbbRes.SetText( aStrRes ); - - ::com::sun::star::awt::Size aDefault( 10000, 10000 ); - ::com::sun::star::awt::Size aSize; - aSize = pConfigItem->ReadSize( String( ResId( KEY_SIZE, *pMgr ) ), aDefault ); - - aCbxRLE.Check( bRleCoding ); - - aMtfSizeX.SetDefaultUnit( FUNIT_MM ); - aMtfSizeY.SetDefaultUnit( FUNIT_MM ); - - aMtfSizeX.SetValue( aSize.Width ); - aMtfSizeY.SetValue( aSize.Height ); - - switch ( rPara.eFieldUnit ) - { -// case FUNIT_NONE : -// case FUNIT_KM : -// case FUNIT_PERCENT : -// case FUNIT_CUSTOM : -// case FUNIT_MILE : -// case FUNIT_FOOT : -// case FUNIT_M : - case FUNIT_MM : - case FUNIT_CM : - case FUNIT_TWIP : - case FUNIT_POINT : - case FUNIT_PICA : - case FUNIT_INCH : - case FUNIT_100TH_MM : - { - aMtfSizeX.SetUnit( rPara.eFieldUnit ); - aMtfSizeY.SetUnit( rPara.eFieldUnit ); - } - break; - - default: - break; // -Wall multiple values not handled. - } - - switch ( nMode ) - { - case 2 : - { - aRbSize.Check( TRUE ); - ClickRbSize( NULL ); - } - break; - case 1 : - { - aRbRes.Check( TRUE ); - ClickRbRes( NULL ); - } - break; - default : - { - aRbOriginal.Check( TRUE ); - ClickRbOriginal( NULL ); - } - break; - } - SelectLbColors( &aLbColors ); -} - -DlgExportPix::~DlgExportPix() -{ - delete pConfigItem; -} - - -/************************************************************************* -|* -|* Speichert eingestellte Werte in ini-Datei -|* -\************************************************************************/ - -IMPL_LINK( DlgExportPix, OK, void *, EMPTYARG ) -{ - // Config-Parameter schreiben - - sal_Int32 nRes = Max( Min( aCbbRes.GetText().ToInt32(), sal_Int32( 600 ) ), sal_Int32( 75 ) ); - ::com::sun::star::awt::Size aSize( - static_cast<long>(MetricField::ConvertDoubleValue( static_cast<double>(aMtfSizeX.GetValue()), 2, aMtfSizeX.GetUnit(), MAP_100TH_MM )), - static_cast<long>(MetricField::ConvertDoubleValue( static_cast<double>(aMtfSizeY.GetValue()), 2, aMtfSizeY.GetUnit(), MAP_100TH_MM )) ); - - sal_Int32 nMode; - if ( aRbRes.IsChecked() ) - nMode = 1; - else if ( aRbSize.IsChecked() ) - nMode = 2; - else - nMode = 0; - - pConfigItem->WriteInt32( String( ResId( KEY_MODE, *pMgr ) ), nMode ); - pConfigItem->WriteInt32( String( ResId( KEY_RES, *pMgr ) ), nRes ); - pConfigItem->WriteSize( String( ResId( KEY_SIZE, *pMgr ) ), aSize ); - pConfigItem->WriteInt32( String( ResId( KEY_COLORS, *pMgr ) ), (sal_Int32)aLbColors.GetSelectEntryPos() ); - pConfigItem->WriteBool( String( ResId( KEY_RLE_CODING, *pMgr ) ), aCbxRLE.IsChecked() ); - rFltCallPara.aFilterData = pConfigItem->GetFilterData(); - EndDialog( RET_OK ); - - return 0; -} - -/************************************************************************* -|* -|* Enabled/Disabled Controls -|* -\************************************************************************/ - -IMPL_LINK( DlgExportPix, ClickRbOriginal, void*, EMPTYARG ) -{ - aCbbRes.Disable(); - - aFtSizeX.Disable(); - aMtfSizeX.Disable(); - aFtSizeY.Disable(); - aMtfSizeY.Disable(); - - return 0; -} - - -/************************************************************************* -|* -|* Enabled/Disabled Controls -|* -\************************************************************************/ - -IMPL_LINK( DlgExportPix, ClickRbRes, void*, EMPTYARG ) -{ - aCbbRes.Enable(); - - aFtSizeX.Disable(); - aMtfSizeX.Disable(); - aFtSizeY.Disable(); - aMtfSizeY.Disable(); - - return 0; -} - - -/************************************************************************* -|* -|* Enabled/Disabled Controls -|* -\************************************************************************/ - -IMPL_LINK( DlgExportPix, ClickRbSize, void*, EMPTYARG ) -{ - aFtSizeX.Enable(); - aMtfSizeX.Enable(); - aFtSizeY.Enable(); - aMtfSizeY.Enable(); - - aCbbRes.Disable(); - - return 0; -} - - -/************************************************************************* -|* -|* Enabled/Disabled Controls -|* -\************************************************************************/ - -IMPL_LINK( DlgExportPix, SelectLbColors, void*, EMPTYARG ) -{ - const USHORT nLbPos = aLbColors.GetSelectEntryPos(); - - if ( ( nLbPos >= 3 ) && ( nLbPos <= 6 ) ) - aCbxRLE.Enable(); - else - aCbxRLE.Disable(); - - return 0L; -} - - -/******************************************************************************/ - - -/************************************************************************* -|* -|* Ctor -|* -\************************************************************************/ - -DlgExportVec::DlgExportVec( FltCallDialogParameter& rPara ) : - ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_VEC, *rPara.pResMgr ) ), - rFltCallPara ( rPara ), - aBtnOK ( this, ResId( BTN_OK_VEC, *rPara.pResMgr ) ), - aBtnCancel ( this, ResId( BTN_CANCEL_VEC, *rPara.pResMgr ) ), - aBtnHelp ( this, ResId( BTN_HELP_VEC, *rPara.pResMgr ) ), - aRbOriginal ( this, ResId( RB_ORIGINAL_VEC, *rPara.pResMgr ) ), - aRbSize ( this, ResId( RB_SIZE_VEC, *rPara.pResMgr ) ), - aGrpMode ( this, ResId( GRP_MODE_VEC, *rPara.pResMgr ) ), - aFtSizeX ( this, ResId( FT_SIZEX_VEC, *rPara.pResMgr ) ), - aMtfSizeX ( this, ResId( MTF_SIZEX_VEC, *rPara.pResMgr ) ), - aFtSizeY ( this, ResId( FT_SIZEY_VEC, *rPara.pResMgr ) ), - aMtfSizeY ( this, ResId( MTF_SIZEY_VEC, *rPara.pResMgr ) ), - aGrpSize ( this, ResId( GRP_SIZE_VEC, *rPara.pResMgr ) ), - pMgr ( rPara.pResMgr ), - aExt ( rPara.aFilterExt ) -{ - aExt.ToUpperAscii(); - String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/" ) ); - aFilterConfigPath.Append( aExt ); - pConfigItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData ); - - String aTitle( aExt ); - FreeResource(); - - aBtnOK.SetClickHdl( LINK( this, DlgExportVec, OK ) ); - aRbOriginal.SetClickHdl( LINK( this, DlgExportVec, ClickRbOriginal ) ); - aRbSize.SetClickHdl( LINK( this, DlgExportVec, ClickRbSize ) ); - - aTitle.ToUpperAscii(); - aTitle += String( ResId( EXPORT_DIALOG_TITLE, *pMgr ) ); - SetText( aTitle ); - - // reading config-parameter - sal_Int32 nMode = pConfigItem->ReadInt32( String( ResId( KEY_MODE, *pMgr ) ), 0 ); - - ::com::sun::star::awt::Size aDefault( 10000, 10000 ); - ::com::sun::star::awt::Size aSize; - aSize = pConfigItem->ReadSize( String( ResId( KEY_SIZE, *pMgr ) ), aDefault ); - - aMtfSizeX.SetDefaultUnit( FUNIT_MM ); - aMtfSizeY.SetDefaultUnit( FUNIT_MM ); - aMtfSizeX.SetValue( aSize.Width ); - aMtfSizeY.SetValue( aSize.Height ); - - switch ( rPara.eFieldUnit ) - { -// case FUNIT_NONE : -// case FUNIT_KM : -// case FUNIT_PERCENT : -// case FUNIT_CUSTOM : -// case FUNIT_MILE : -// case FUNIT_FOOT : - case FUNIT_MM : - case FUNIT_CM : - case FUNIT_M : - case FUNIT_TWIP : - case FUNIT_POINT : - case FUNIT_PICA : - case FUNIT_INCH : - case FUNIT_100TH_MM : - { - aMtfSizeX.SetUnit( rPara.eFieldUnit ); - aMtfSizeY.SetUnit( rPara.eFieldUnit ); - } - break; - default: - break; // -Wall Multiple values not handled. - } - - switch ( nMode ) - { - case 1 : - { - aRbSize.Check( TRUE ); - ClickRbSize( NULL ); - } - break; - - default : - { - aRbOriginal.Check( TRUE ); - ClickRbOriginal( NULL ); - } - break; - } -} - -DlgExportVec::~DlgExportVec() -{ - delete pConfigItem; -} -/************************************************************************* -|* -|* Speichert eingestellte Werte in ini-Datei -|* -\************************************************************************/ - -IMPL_LINK( DlgExportVec, OK, void *, EMPTYARG ) -{ - // Config-Parameter schreiben - ::com::sun::star::awt::Size aSize( - static_cast<long>(MetricField::ConvertDoubleValue( static_cast<double>(aMtfSizeX.GetValue()), 2, aMtfSizeX.GetUnit(), MAP_100TH_MM )), - static_cast<long>(MetricField::ConvertDoubleValue( static_cast<double>(aMtfSizeY.GetValue()), 2, aMtfSizeY.GetUnit(), MAP_100TH_MM )) ); - - sal_Int32 nMode; - if ( aRbSize.IsChecked() ) - nMode = 1; - else - nMode = 0; - - pConfigItem->WriteInt32( String( ResId( KEY_MODE, *pMgr ) ), nMode ); - pConfigItem->WriteSize( String( ResId( KEY_SIZE, *pMgr ) ), aSize ); - rFltCallPara.aFilterData = pConfigItem->GetFilterData(); - EndDialog( RET_OK ); - - return 0; -} - -/************************************************************************* -|* -|* Enabled/Disabled Controls -|* -\************************************************************************/ - -IMPL_LINK( DlgExportVec, ClickRbOriginal, void*, EMPTYARG ) -{ - aGrpSize.Disable(); - aFtSizeX.Disable(); - aMtfSizeX.Disable(); - aFtSizeY.Disable(); - aMtfSizeY.Disable(); - - return 0; -} - - -/************************************************************************* -|* -|* Enabled/Disabled Controls -|* -\************************************************************************/ - -IMPL_LINK( DlgExportVec, ClickRbSize, void*, EMPTYARG ) -{ - aGrpSize.Enable(); - aFtSizeX.Enable(); - aMtfSizeX.Enable(); - aFtSizeY.Enable(); - aMtfSizeY.Enable(); - - return 0; -} - - - diff --git a/svtools/source/filter.vcl/filter/dlgexpor.hrc b/svtools/source/filter.vcl/filter/dlgexpor.hrc deleted file mode 100644 index 69870c9b00b0..000000000000 --- a/svtools/source/filter.vcl/filter/dlgexpor.hrc +++ /dev/null @@ -1,58 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include <svtools/svtools.hrc> - -#define BTN_OK_PIX 1 -#define BTN_CANCEL_PIX 1 -#define BTN_HELP_PIX 1 -#define CBX_RES_PIX 1 -#define CBX_SIZE_PIX 2 -#define CBX_RLE 3 -#define CBB_RES_PIX 1 -#define LB_COLORS 1 -#define MTF_SIZEX_PIX 1 -#define MTF_SIZEY_PIX 2 -#define FT_SIZEX_PIX 1 -#define FT_SIZEY_PIX 2 -#define GRP_MODE_PIX 1 -#define GRP_COLORS 4 -#define RB_ORIGINAL_PIX 1 -#define RB_RES_PIX 2 -#define RB_SIZE_PIX 3 - -#define BTN_OK_VEC 1 -#define BTN_CANCEL_VEC 1 -#define BTN_HELP_VEC 1 -#define CBX_SIZE_VEC 2 -#define MTF_SIZEX_VEC 1 -#define MTF_SIZEY_VEC 2 -#define FT_SIZEX_VEC 1 -#define FT_SIZEY_VEC 2 -#define GRP_SIZE_VEC 1 -#define GRP_MODE_VEC 2 -#define RB_ORIGINAL_VEC 1 -#define RB_SIZE_VEC 2 diff --git a/svtools/source/filter.vcl/filter/dlgexpor.hxx b/svtools/source/filter.vcl/filter/dlgexpor.hxx deleted file mode 100644 index 8c7b2d462e70..000000000000 --- a/svtools/source/filter.vcl/filter/dlgexpor.hxx +++ /dev/null @@ -1,127 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#ifndef _DLGEXPOR_HXX_ -#define _DLGEXPOR_HXX_ - -#include <svtools/fltcall.hxx> -#include <vcl/dialog.hxx> -#include <vcl/button.hxx> -#include <vcl/fixed.hxx> -#include <vcl/field.hxx> -#include <vcl/lstbox.hxx> - -/************************************************************************* -|* -|* Dialog zum Einstellen von Filteroptionen bei Pixelformaten -|* -\************************************************************************/ - -class FilterConfigItem; -class DlgExportPix : public ModalDialog -{ -private: - - FltCallDialogParameter& rFltCallPara; - - OKButton aBtnOK; - CancelButton aBtnCancel; - HelpButton aBtnHelp; - - ListBox aLbColors; - CheckBox aCbxRLE; - FixedLine aGrpColors; - - RadioButton aRbOriginal; - RadioButton aRbRes; - RadioButton aRbSize; - FixedText aFtSizeX; - MetricField aMtfSizeX; - FixedText aFtSizeY; - MetricField aMtfSizeY; - FixedLine aGrpMode; - ComboBox aCbbRes; - - FilterConfigItem* pConfigItem; - ResMgr* pMgr; - - String aExt; - - DECL_LINK( OK, void* p ); - DECL_LINK( ClickRbOriginal,void* p ); - DECL_LINK( ClickRbRes,void* p ); - DECL_LINK( ClickRbSize,void* p ); - DECL_LINK( SelectLbColors, void* p ); - -public: - DlgExportPix( FltCallDialogParameter& rPara ); - ~DlgExportPix(); -}; - - -/************************************************************************* -|* -|* Dialog zum Einstellen von Filteroptionen bei Vektorformaten -|* -\************************************************************************/ -class DlgExportVec : public ModalDialog -{ -private: - - FltCallDialogParameter& rFltCallPara; - - OKButton aBtnOK; - CancelButton aBtnCancel; - HelpButton aBtnHelp; - - RadioButton aRbOriginal; - RadioButton aRbSize; - FixedLine aGrpMode; - - FixedText aFtSizeX; - MetricField aMtfSizeX; - FixedText aFtSizeY; - MetricField aMtfSizeY; - FixedLine aGrpSize; - - FilterConfigItem* pConfigItem; - ResMgr* pMgr; - - String aExt; - - DECL_LINK( OK, void* p ); - DECL_LINK( ClickRbOriginal,void* p ); - DECL_LINK( ClickRbSize,void* p ); - -public: - DlgExportVec( FltCallDialogParameter& rPara ); - ~DlgExportVec(); -}; - -#endif // _DLGEXPOR_HXX_ - diff --git a/svtools/source/filter.vcl/filter/dlgexpor.src b/svtools/source/filter.vcl/filter/dlgexpor.src deleted file mode 100644 index 7573b394d72f..000000000000 --- a/svtools/source/filter.vcl/filter/dlgexpor.src +++ /dev/null @@ -1,315 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#include "dlgexpor.hrc" - -ModalDialog DLG_EXPORT_PIX -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 178 , 135 ) ; - Moveable = TRUE ; - Closeable = TRUE ; - FixedLine GRP_COLORS - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 110 , 8 ) ; - Text [ en-US ] = "Color resolution" ; - }; - ListBox LB_COLORS - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 98 , 90 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - AutoHScroll = TRUE ; - StringList [ en-US ] = - { - < "Original" ; Default ; > ; - < "1 Bit - Threshold Value" ; Default ; > ; - < "1 Bit - Dithering" ; Default ; > ; - < "4 Bit - Grayscale" ; Default ; > ; - < "4 Bit - Color Palette" ; Default ; > ; - < "8 Bit - Grayscales" ; Default ; > ; - < "8 Bit - Color Palette" ; Default ; > ; - < "24 Bit - True Colors" ; Default ; > ; - }; - }; - CheckBox CBX_RLE - { - Pos = MAP_APPFONT ( 12 , 31 ) ; - Size = MAP_APPFONT ( 98 , 12 ) ; - TabStop = TRUE ; - Text [ en-US ] = "RLE coding" ; - }; - FixedLine GRP_MODE_PIX - { - Pos = MAP_APPFONT ( 6 , 48 ) ; - Size = MAP_APPFONT ( 110 , 8 ) ; - Text [ en-US ] = "Mode" ; - }; - RadioButton RB_ORIGINAL_PIX - { - Pos = MAP_APPFONT ( 12 , 59 ) ; - Size = MAP_APPFONT ( 98 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Original" ; - }; - RadioButton RB_RES_PIX - { - Pos = MAP_APPFONT ( 12 , 73 ) ; - Size = MAP_APPFONT ( 55 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Resolution" ; - }; - ComboBox CBB_RES_PIX - { - Pos = MAP_APPFONT ( 70 , 73 ) ; - Size = MAP_APPFONT ( 40 , 50 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - StringList = - { - "75 DPI" ; - "150 DPI" ; - "300 DPI" ; - "600 DPI" ; - }; - }; - RadioButton RB_SIZE_PIX - { - Pos = MAP_APPFONT ( 12 , 87 ) ; - Size = MAP_APPFONT ( 98 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Size" ; - }; - MetricField MTF_SIZEX_PIX - { - Border = TRUE ; - Pos = MAP_APPFONT ( 60 , 101 ) ; - Size = MAP_APPFONT ( 50 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 100 ; - Maximum = 99999 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - First = 100 ; - Last = 99999 ; - SpinSize = 100 ; - }; - FixedText FT_SIZEX_PIX - { - Pos = MAP_APPFONT ( 18 , 102 ) ; - Size = MAP_APPFONT ( 41 , 10 ) ; - Text [ en-US ] = "Width" ; - }; - MetricField MTF_SIZEY_PIX - { - Border = TRUE ; - Pos = MAP_APPFONT ( 60 , 117 ) ; - Size = MAP_APPFONT ( 50 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 100 ; - Maximum = 99999 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - First = 100 ; - Last = 99999 ; - SpinSize = 100 ; - }; - FixedText FT_SIZEY_PIX - { - Pos = MAP_APPFONT ( 18 , 118 ) ; - Size = MAP_APPFONT ( 41 , 10 ) ; - Text [ en-US ] = "Height" ; - }; - OKButton BTN_OK_PIX - { - Pos = MAP_APPFONT ( 122 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BTN_CANCEL_PIX - { - Pos = MAP_APPFONT ( 122 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BTN_HELP_PIX - { - Pos = MAP_APPFONT ( 122 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; -}; -ModalDialog DLG_EXPORT_VEC -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 178 , 89 ) ; - Moveable = TRUE ; - Closeable = TRUE ; - - FixedLine GRP_MODE_VEC - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 110 , 8 ) ; - Text [ en-US ] = "Mode" ; - }; - RadioButton RB_ORIGINAL_VEC - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 98 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Original" ; - }; - RadioButton RB_SIZE_VEC - { - Pos = MAP_APPFONT ( 12 , 28 ) ; - Size = MAP_APPFONT ( 98 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Size" ; - }; - FixedLine GRP_SIZE_VEC - { - Pos = MAP_APPFONT ( 6 , 44 ) ; - Size = MAP_APPFONT ( 110 , 8 ) ; - Text [ en-US ] = "Size" ; - }; - FixedText FT_SIZEX_VEC - { - Pos = MAP_APPFONT ( 12 , 56 ) ; - Size = MAP_APPFONT ( 45 , 10 ) ; - Text [ en-US ] = "Width" ; - }; - MetricField MTF_SIZEX_VEC - { - Border = TRUE ; - Pos = MAP_APPFONT ( 60 , 55 ) ; - Size = MAP_APPFONT ( 50 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 100 ; - Maximum = 99999 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - First = 100 ; - Last = 99999 ; - SpinSize = 100 ; - }; - FixedText FT_SIZEY_VEC - { - Pos = MAP_APPFONT ( 12 , 72 ) ; - Size = MAP_APPFONT ( 45 , 10 ) ; - Text [ en-US ] = "Height" ; - }; - MetricField MTF_SIZEY_VEC - { - Border = TRUE ; - Pos = MAP_APPFONT ( 60 , 71 ) ; - Size = MAP_APPFONT ( 50 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 100 ; - Maximum = 99999 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - First = 100 ; - Last = 99999 ; - SpinSize = 100 ; - }; - OKButton BTN_OK_VEC - { - Pos = MAP_APPFONT ( 122 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BTN_CANCEL_VEC - { - Pos = MAP_APPFONT ( 122 , 24 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BTN_HELP_VEC - { - Pos = MAP_APPFONT ( 122 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/svtools/source/filter.vcl/filter/exportdialog.cxx b/svtools/source/filter.vcl/filter/exportdialog.cxx new file mode 100644 index 000000000000..20cc46a30ab5 --- /dev/null +++ b/svtools/source/filter.vcl/filter/exportdialog.cxx @@ -0,0 +1,1513 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_svtools.hxx" + +#ifndef GCC +# pragma hdrstop +#endif + +#include <tools/ref.hxx> +#include <tools/stream.hxx> +#include <svtools/filter.hxx> +#include <svtools/FilterConfigItem.hxx> +#include <com/sun/star/io/XStream.hpp> +#include <com/sun/star/awt/Size.hpp> +#include <com/sun/star/view/XSelectionSupplier.hpp> +#include <com/sun/star/frame/XModel.hpp> +#include <com/sun/star/frame/XController.hpp> +#include <com/sun/star/drawing/XDrawView.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/graphic/XPrimitiveFactory2D.hpp> +#include <com/sun/star/geometry/AffineMatrix2D.hpp> +#include <com/sun/star/document/XExporter.hpp> +#include <com/sun/star/document/XFilter.hpp> +#include <unotools/streamwrap.hxx> +#include <vcl/msgbox.hxx> +#include <vcl/svapp.hxx> +#include <vcl/outdev.hxx> +#include <vcl/graph.hxx> +#include <rtl/ustrbuf.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include "exportdialog.hxx" +#include "exportdialog.hrc" + +#define FORMAT_UNKNOWN 0 +#define FORMAT_JPG 1 +#define FORMAT_PNG 2 +#define FORMAT_BMP 3 +#define FORMAT_GIF 4 +#define FORMAT_PBM 5 +#define FORMAT_PGM 6 +#define FORMAT_PPM 7 +#define FORMAT_PCT 8 +#define FORMAT_RAS 9 +#define FORMAT_TIF 10 +#define FORMAT_XPM 11 +#define FORMAT_WMF 12 +#define FORMAT_EMF 13 +#define FORMAT_EPS 14 +#define FORMAT_MET 15 +#define FORMAT_SVG 16 +#define FORMAT_SVM 17 + +#define UNIT_DEFAULT -1 +#define UNIT_INCH 0 +#define UNIT_CM 1 +#define UNIT_MM 2 +#define UNIT_POINT 3 +#define UNIT_PIXEL 4 +#define UNIT_MAX_ID UNIT_PIXEL + +using namespace ::com::sun::star; + +static sal_Int16 GetFilterFormat( String& rExt ) +{ + sal_Int16 nFormat = FORMAT_UNKNOWN; + ByteString aExt( rExt, RTL_TEXTENCODING_UTF8 ); + if ( aExt.Equals( "JPG" ) ) + nFormat = FORMAT_JPG; + else if ( aExt.Equals( "PNG" ) ) + nFormat = FORMAT_PNG; + else if ( aExt.Equals( "BMP" ) ) + nFormat = FORMAT_BMP; + else if ( aExt.Equals( "GIF" ) ) + nFormat = FORMAT_GIF; + else if ( aExt.Equals( "PBM" ) ) + nFormat = FORMAT_PBM; + else if ( aExt.Equals( "PGM" ) ) + nFormat = FORMAT_PGM; + else if ( aExt.Equals( "PPM" ) ) + nFormat = FORMAT_PPM; + else if ( aExt.Equals( "PCT" ) ) + nFormat = FORMAT_PCT; + else if ( aExt.Equals( "RAS" ) ) + nFormat = FORMAT_RAS; + else if ( aExt.Equals( "TIF" ) ) + nFormat = FORMAT_TIF; + else if ( aExt.Equals( "XPM" ) ) + nFormat = FORMAT_XPM; + else if ( aExt.Equals( "WMF" ) ) + nFormat = FORMAT_WMF; + else if ( aExt.Equals( "EMF" ) ) + nFormat = FORMAT_EMF; + else if ( aExt.Equals( "EPS" ) ) + nFormat = FORMAT_EPS; + else if ( aExt.Equals( "MET" ) ) + nFormat = FORMAT_MET; + else if ( aExt.Equals( "SVG" ) ) + nFormat = FORMAT_SVG; + else if ( aExt.Equals( "SVM" ) ) + nFormat = FORMAT_SVM; + return nFormat; +} + +static MapUnit GetMapUnit( sal_Int32 nUnit ) +{ + MapUnit aMapUnit( MAP_PIXEL ); + switch( nUnit ) + { + case UNIT_INCH : aMapUnit = MAP_INCH; break; + case UNIT_CM : aMapUnit = MAP_CM; break; + case UNIT_MM : aMapUnit = MAP_MM; break; + case UNIT_POINT : aMapUnit = MAP_POINT; break; + case UNIT_PIXEL : aMapUnit = MAP_PIXEL; break; + } + return aMapUnit; +} + +sal_Int32 ExportDialog::GetDefaultUnit() +{ + sal_Int32 nDefaultUnit = UNIT_CM; + switch( mrFltCallPara.eFieldUnit ) + { +// case FUNIT_NONE : +// case FUNIT_PERCENT : +// case FUNIT_CUSTOM : + default: nDefaultUnit = UNIT_CM; break; + + case FUNIT_MILE : // PASSTHROUGH INTENDED + case FUNIT_FOOT : + case FUNIT_TWIP : + case FUNIT_PICA : nDefaultUnit = UNIT_INCH; break; + + case FUNIT_KM : // PASSTHROUGH INTENDED + case FUNIT_M : + case FUNIT_100TH_MM : nDefaultUnit = UNIT_CM; break; + + case FUNIT_INCH : nDefaultUnit = UNIT_INCH; break; + case FUNIT_CM : nDefaultUnit = UNIT_CM; break; + case FUNIT_MM : nDefaultUnit = UNIT_MM; break; + case FUNIT_POINT : nDefaultUnit = UNIT_POINT; break; + } + return nDefaultUnit; +} + +static basegfx::B2DRange GetShapeRangeForXShape( const uno::Reference< drawing::XShape >& rxShape, + const uno::Reference< graphic::XPrimitiveFactory2D >& rxPrimitiveFactory2D, const uno::Sequence< beans::PropertyValue >& rViewInformation ) +{ + basegfx::B2DRange aShapeRange; + + const uno::Sequence< beans::PropertyValue > aParams; + const uno::Sequence< uno::Reference< graphic::XPrimitive2D > > aPrimitiveSequence( rxPrimitiveFactory2D->createPrimitivesFromXShape( rxShape, aParams ) ); + + const sal_Int32 nCount = aPrimitiveSequence.getLength(); + for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ ) + { + const geometry::RealRectangle2D aRect( aPrimitiveSequence[ nIndex ]->getRange( rViewInformation ) ); + aShapeRange.expand( basegfx::B2DTuple( aRect.X1, aRect.Y1 ) ); + aShapeRange.expand( basegfx::B2DTuple( aRect.X2, aRect.Y2 ) ); + } + return aShapeRange; +} + +uno::Sequence< beans::PropertyValue > ExportDialog::GetFilterData( sal_Bool bUpdateConfig ) +{ + if ( bUpdateConfig ) + { + sal_Int32 nUnit = maLbSizeX.GetSelectEntryPos(); + if ( nUnit < 0 ) + nUnit = UNIT_CM; + + if ( ( mnInitialResolutionUnit == UNIT_DEFAULT ) && ( nUnit == GetDefaultUnit() ) ) + nUnit = UNIT_DEFAULT; + + // updating ui configuration + if ( mbIsPixelFormat ) + { + if ( nUnit > UNIT_MAX_ID ) + nUnit = UNIT_PIXEL; + + sal_Int32 nResolution = maNfResolution.GetValue(); + if ( nResolution < 1 ) + nResolution = 96; + + mpOptionsItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportUnit" ) ), nUnit ); + mpOptionsItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportResolution" ) ), nResolution ); + mpOptionsItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportResolutionUnit" ) ), maLbResolution.GetSelectEntryPos() ); + } + else + { + if ( nUnit >= UNIT_PIXEL ) + nUnit = UNIT_CM; + + mpOptionsItem->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "VectorExportUnit" ) ), nUnit ); + } + } + + FilterConfigItem* pFilterOptions; + if ( bUpdateConfig ) + pFilterOptions = mpFilterOptionsItem; + else + { + uno::Sequence< beans::PropertyValue > aFilterData( mpFilterOptionsItem->GetFilterData() ); + pFilterOptions = new FilterConfigItem( &aFilterData ); + } + + const String sLogicalWidth( String( RTL_CONSTASCII_USTRINGPARAM( "LogicalWidth" ) ) ); + const String sLogicalHeight( String( RTL_CONSTASCII_USTRINGPARAM( "LogicalHeight" ) ) ); + if ( mbIsPixelFormat ) + { + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelWidth" ) ), static_cast< sal_Int32 >( maSize.Width ) ); + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelHeight" ) ), static_cast< sal_Int32 >( maSize.Height ) ); + if ( maResolution.Width && maResolution.Height ) + { + const double f100thmmPerPixelX = 100000.0 / maResolution.Width; + const double f100thmmPerPixelY = 100000.0 / maResolution.Height; + sal_Int32 nLogicalWidth = static_cast< sal_Int32 >( f100thmmPerPixelX * maSize.Width ); + sal_Int32 nLogicalHeight= static_cast< sal_Int32 >( f100thmmPerPixelY * maSize.Height ); + if ( nLogicalWidth && nLogicalHeight ) + { + pFilterOptions->WriteInt32( sLogicalWidth, nLogicalWidth ); + pFilterOptions->WriteInt32( sLogicalHeight, nLogicalHeight ); + } + } + } + else + { + pFilterOptions->WriteInt32( sLogicalWidth, static_cast< sal_Int32 >( maSize.Width ) ); + pFilterOptions->WriteInt32( sLogicalHeight, static_cast< sal_Int32 >( maSize.Height ) ); + } + switch ( mnFormat ) + { + case FORMAT_JPG : + { + sal_Int32 nColor = maLbColorDepth.GetSelectEntryPos(); + if ( nColor == 1 ) + nColor = 0; + else + nColor = 1; + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ColorMode" ) ), nColor ); + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), static_cast< sal_Int32 >( maSbCompression.GetThumbPos() ) ); + } + break; + + case FORMAT_PNG : + { + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Compression" ) ), static_cast< sal_Int32 >( maSbCompression.GetThumbPos() ) ); + sal_Int32 nInterlace = 0; + if ( maCbInterlaced.IsChecked() ) + nInterlace++; + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), nInterlace ); + } + break; + + case FORMAT_BMP : + { + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Color" ) ), maLbColorDepth.GetSelectEntryPos() + 1 ); + pFilterOptions->WriteBool( String( RTL_CONSTASCII_USTRINGPARAM( "RLE_Coding" ) ), maCbRLEEncoding.IsChecked() ); + } + break; + + case FORMAT_GIF : + { + sal_Int32 nValue = 0; + if ( maCbInterlaced.IsChecked() ) + nValue++; + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), nValue ); + + nValue = 0; + if ( maCbSaveTransparency.IsChecked() ) + nValue++; + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Translucent" ) ), nValue ); + } + break; + + case FORMAT_PBM : + case FORMAT_PGM : + case FORMAT_PPM : + { + sal_Int32 nFormat = 0; + if ( maRbText.IsChecked() ) + nFormat++; + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "FileFormat" ) ), nFormat ); + } + break; + + case FORMAT_EPS : + { + sal_Int32 nCheck = 0; + if ( maCbEPSPreviewTIFF.IsChecked() ) + nCheck++; + if ( maCbEPSPreviewEPSI.IsChecked() ) + nCheck += 2; + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Preview" ) ), nCheck ); + + nCheck = 1; + if ( maRbEPSLevel2.IsChecked() ) + nCheck++; + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ), nCheck ); + + nCheck = 1; + if ( maRbEPSColorFormat2.IsChecked() ) + nCheck++; + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ColorFormat" ) ), nCheck ); + + nCheck = 1; + if ( maRbEPSCompressionNone.IsChecked() ) + nCheck++; + pFilterOptions->WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "CompressionMode" ) ), nCheck ); + } + break; + } + + uno::Sequence< beans::PropertyValue > aRet( pFilterOptions->GetFilterData() ); + if ( bUpdateConfig == sal_False ) + delete pFilterOptions; + return aRet; +} + +// +awt::Size ExportDialog::GetOriginalSize() +{ + basegfx::B2DRange aShapesRange; + + if ( mxPage.is () ) + { + uno::Reference< beans::XPropertySet > xPagePropSet( mxPage, uno::UNO_QUERY ); + if ( xPagePropSet.is() ) + { + sal_Int32 nWidth = 0; + sal_Int32 nHeight= 0; + com::sun::star::uno::Any aAny; + aAny = xPagePropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Width" ) ) ); + aAny >>= nWidth; + aAny = xPagePropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ) ); + aAny >>= nHeight; + aShapesRange = basegfx::B2DRange( 0, 0, nWidth, nHeight ); + } + } + else + { + uno::Reference< graphic::XPrimitiveFactory2D > xPrimitiveFactory( + mxMgr->createInstance( String( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.graphic.PrimitiveFactory2D" ) ) ), uno::UNO_QUERY ); + if ( xPrimitiveFactory.is() ) + { + basegfx::B2DHomMatrix aViewTransformation( Application::GetDefaultDevice()->GetViewTransformation() ); + com::sun::star::geometry::AffineMatrix2D aTransformation; + aTransformation.m00 = aViewTransformation.get(0,0); + aTransformation.m01 = aViewTransformation.get(0,1); + aTransformation.m02 = aViewTransformation.get(0,2); + aTransformation.m10 = aViewTransformation.get(1,0); + aTransformation.m11 = aViewTransformation.get(1,1); + aTransformation.m12 = aViewTransformation.get(1,2); + + const rtl::OUString sViewTransformation( RTL_CONSTASCII_USTRINGPARAM( "ViewTransformation" ) ); + uno::Sequence< beans::PropertyValue > aViewInformation( 1 ); + aViewInformation[ 0 ].Value <<= aTransformation; + aViewInformation[ 0 ].Name = sViewTransformation; + + if ( mxShape.is() ) + aShapesRange = GetShapeRangeForXShape( mxShape, xPrimitiveFactory, aViewInformation ); + else if ( mxShapes.is() ) + { + const sal_Int32 nCount = mxShapes->getCount(); + for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ ) + { + uno::Reference< drawing::XShape > xShape; + mxShapes->getByIndex( nIndex ) >>= xShape; + aShapesRange.expand( GetShapeRangeForXShape( xShape, xPrimitiveFactory, aViewInformation ) ); + } + } + } + } + return awt::Size( static_cast<sal_Int32>(aShapesRange.getWidth()), static_cast<sal_Int32>(aShapesRange.getHeight()) ); +} + +void ExportDialog::GetGraphicSource() +{ + if ( mxSourceDocument.is() ) + { + uno::Reference< frame::XModel > xModel( mxSourceDocument, uno::UNO_QUERY ); + if ( xModel.is() ) + { + uno::Reference< frame::XController > xController( xModel->getCurrentController() ); + if ( xController.is() ) + { + if ( mbExportSelection ) // check if there is a selection + { + uno::Reference< view::XSelectionSupplier > xSelectionSupplier( xController, uno::UNO_QUERY ); + if ( xSelectionSupplier.is() ) + { + uno::Any aAny( xSelectionSupplier->getSelection() ); + if ( ! ( aAny >>= mxShapes ) ) + aAny >>= mxShape; + } + } + if ( !mxShape.is() && !mxShapes.is() ) + { + uno::Reference< drawing::XDrawView > xDrawView( xController, uno::UNO_QUERY ); + if ( xDrawView.is() ) + { + uno::Reference< drawing::XDrawPage > xCurrentPage( xDrawView->getCurrentPage() ); + if ( xCurrentPage.is() ) + { + mxPage = xCurrentPage; // exporting whole page + } + } + } + } + } + } +} + +sal_Bool ExportDialog::GetGraphicStream() +{ + sal_Bool bRet = sal_False; + + if ( !IsTempExportAvailable() ) + { + delete mpTempStream, mpTempStream = new SvMemoryStream(); + maBitmap = Bitmap(); + return bRet; + } + + sal_Bool bRecreateOutputStream = mpTempStream->Tell() == 0; + + static uno::Sequence< beans::PropertyValue > aOldFilterData; + uno::Sequence< beans::PropertyValue > aNewFilterData( GetFilterData( sal_False ) ); + if ( aOldFilterData != aNewFilterData ) + { + aOldFilterData = aNewFilterData; + bRecreateOutputStream = sal_True; + } + try + { + if ( bRecreateOutputStream ) + { + delete mpTempStream, mpTempStream = new SvMemoryStream(); + maBitmap = Bitmap(); + + uno::Reference < io::XStream > xStream( new utl::OStreamWrapper( *mpTempStream ) ); + uno::Reference < io::XOutputStream > xOutputStream( xStream->getOutputStream() ); + + uno::Reference< document::XExporter > xGraphicExporter( + mxMgr->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GraphicExportFilter") ) ), uno::UNO_QUERY_THROW ); + uno::Reference< document::XFilter > xFilter( xGraphicExporter, uno::UNO_QUERY_THROW ); + + sal_Int32 nProperties = 2; + uno::Sequence< beans::PropertyValue > aFilterData( nProperties ); + + + rtl::OUString sFormat( maExt ); + uno::Sequence< beans::PropertyValue > aDescriptor( 3 ); + aDescriptor[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OutputStream") ); + aDescriptor[0].Value <<= xOutputStream; + aDescriptor[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FilterName") ); + aDescriptor[1].Value <<= sFormat; + aDescriptor[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FilterData") ); + aDescriptor[2].Value <<= aNewFilterData; + + uno::Reference< lang::XComponent > xSourceDoc; + if ( mxPage.is() ) + xSourceDoc = uno::Reference< lang::XComponent >( mxPage, uno::UNO_QUERY_THROW ); + else if ( mxShapes.is() ) + xSourceDoc = uno::Reference< lang::XComponent >( mxShapes, uno::UNO_QUERY_THROW ); + else if ( mxShape.is() ) + xSourceDoc = uno::Reference< lang::XComponent >( mxShape, uno::UNO_QUERY_THROW );; + if ( xSourceDoc.is() ) + { + xGraphicExporter->setSourceDocument( xSourceDoc ); + xFilter->filter( aDescriptor ); + bRet = sal_True; + + if ( mnFormat == FORMAT_JPG ) + { + mpTempStream->Seek( STREAM_SEEK_TO_BEGIN ); + maBitmap = GetGraphicBitmap( *mpTempStream ); + mpTempStream->Seek( STREAM_SEEK_TO_END ); + } + } + } + else + bRet = sal_True; + } + catch( uno::Exception& ) + { + + // ups + + } + return bRet; +} + +Bitmap ExportDialog::GetGraphicBitmap( SvStream& rInputStream ) +{ + Bitmap aRet; + Graphic aGraphic; + GraphicFilter aFilter( sal_False ); + if ( aFilter.ImportGraphic( aGraphic, String(), rInputStream, GRFILTER_FORMAT_NOTFOUND, NULL, 0, NULL ) == GRFILTER_OK ) + { + aRet = aGraphic.GetBitmap(); + } + return aRet; +} + +sal_uInt32 ExportDialog::GetRawFileSize() const +{ + sal_uInt64 nRawFileSize = 0; + if ( mbIsPixelFormat ) + { + sal_Int32 nBitsPerPixel = 24; + String aEntry( maLbColorDepth.GetSelectEntry() ); + if ( ms1BitTreshold == aEntry ) + nBitsPerPixel = 1; + else if ( ms1BitDithered == aEntry ) + nBitsPerPixel = 1; + else if ( ms4BitGrayscale == aEntry ) + nBitsPerPixel = 4; + else if ( ms4BitColorPalette == aEntry ) + nBitsPerPixel = 8; + else if ( ms8BitGrayscale == aEntry ) + nBitsPerPixel = 8; + else if ( ms8BitColorPalette == aEntry ) + nBitsPerPixel = 8; + else if ( ms24BitColor == aEntry ) + nBitsPerPixel = 24; + + if ( mbIsPixelFormat ) + { + nRawFileSize = ( maSize.Width * nBitsPerPixel + 7 ) &~ 7; // rounding up to 8 bits + nRawFileSize /= 8; // in bytes + nRawFileSize *= maSize.Height; + } + if ( nRawFileSize > SAL_MAX_UINT32 ) + nRawFileSize = 0; + } + return static_cast< sal_uInt32 >( nRawFileSize ); +} + +// checks if the source dimension/resolution is not too big +// to determine the exact graphic output size and preview for jpg +sal_Bool ExportDialog::IsTempExportAvailable() const +{ + return GetRawFileSize() < static_cast< sal_uInt32 >( mnMaxFilesizeForRealtimePreview ); +} + +ExportDialog::ExportDialog( FltCallDialogParameter& rPara, + const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > rxMgr, + const com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& rxSourceDocument, + sal_Bool bExportSelection, sal_Bool bIsPixelFormat ) : + ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT, *rPara.pResMgr ) ), + mrFltCallPara ( rPara ), + mpMgr ( rPara.pResMgr ), + mxMgr ( rxMgr ), + mxSourceDocument ( rxSourceDocument ), + maFlExportSize ( this, ResId( FL_EXPORT_SIZE, *rPara.pResMgr ) ), + maFtSizeX ( this, ResId( FT_SIZEX, *rPara.pResMgr ) ), + maMfSizeX ( this, ResId( MF_SIZEX, *rPara.pResMgr ) ), + maLbSizeX ( this, ResId( LB_SIZEX, *rPara.pResMgr ) ), + maFtSizeY ( this, ResId( FT_SIZEY, *rPara.pResMgr ) ), + maMfSizeY ( this, ResId( MF_SIZEY, *rPara.pResMgr ) ), + maLbSizeY ( this, ResId( LB_SIZEY, *rPara.pResMgr ) ), + maFtResolution ( this, ResId( FT_RESOLUTION, *rPara.pResMgr ) ), + maNfResolution ( this, ResId( NF_RESOLUTION, *rPara.pResMgr ) ), + maLbResolution ( this, ResId( LB_RESOLUTION, *rPara.pResMgr ) ), + maFlColorDepth ( this, ResId( FL_COLOR_DEPTH, *rPara.pResMgr ) ), + maLbColorDepth ( this, ResId( LB_COLOR_DEPTH, *rPara.pResMgr ) ), + maFlJPGQuality ( this, ResId( FL_JPG_QUALITY, *rPara.pResMgr ) ), + maFlMode ( this, ResId( FL_MODE, *rPara.pResMgr ) ), + maFlPBMOptions ( this, ResId( FL_PBM_OPTIONS, *rPara.pResMgr ) ), + maSbCompression ( this, ResId( SB_COMPRESSION, *rPara.pResMgr ) ), + maNfCompression ( this, ResId( NF_COMPRESSION, *rPara.pResMgr ) ), + maFtJPGMin ( this, ResId( FT_JPG_MIN, *rPara.pResMgr ) ), + maFtJPGMax ( this, ResId( FT_JPG_MAX, *rPara.pResMgr ) ), + maFtPNGMin ( this, ResId( FT_PNG_MIN, *rPara.pResMgr ) ), + maFtPNGMax ( this, ResId( FT_PNG_MAX, *rPara.pResMgr ) ), + maCbJPGPreview ( this, ResId( CB_JPG_PREVIEW, *rPara.pResMgr ) ), + maCbInterlaced ( this, ResId( CB_INTERLACED, *rPara.pResMgr ) ), + maCbRLEEncoding ( this, ResId( CB_RLE_ENCODING, *rPara.pResMgr ) ), + maFlGIFDrawingObjects ( this, ResId( FL_GIF_DRAWING_OBJECTS, *rPara.pResMgr ) ), + maCbSaveTransparency ( this, ResId( CB_SAVE_TRANSPARENCY, *rPara.pResMgr ) ), + maRbBinary ( this, ResId( RB_BINARY, *rPara.pResMgr ) ), + maRbText ( this, ResId( RB_TEXT, *rPara.pResMgr ) ), + maFlEPSPreview ( this, ResId( FL_EPS_PREVIEW, *rPara.pResMgr ) ), + maCbEPSPreviewTIFF ( this, ResId( CB_EPS_PREVIEW_TIFF, *rPara.pResMgr ) ), + maCbEPSPreviewEPSI ( this, ResId( CB_EPS_PREVIEW_EPSI, *rPara.pResMgr ) ), + maFlEPSVersion ( this, ResId( FL_EPS_VERSION, *rPara.pResMgr ) ), + maRbEPSLevel1 ( this, ResId( RB_EPS_LEVEL1, *rPara.pResMgr ) ), + maRbEPSLevel2 ( this, ResId( RB_EPS_LEVEL2, *rPara.pResMgr ) ), + maFlEPSColorFormat ( this, ResId( FL_EPS_COLOR_FORMAT, *rPara.pResMgr ) ), + maRbEPSColorFormat1 ( this, ResId( RB_EPS_COLOR_FORMAT1, *rPara.pResMgr ) ), + maRbEPSColorFormat2 ( this, ResId( RB_EPS_COLOR_FORMAT2, *rPara.pResMgr ) ), + maFlCompression ( this, ResId( FL_COMPRESSION, *rPara.pResMgr ) ), + maRbEPSCompressionLZW ( this, ResId( RB_EPS_COMPRESSION_LZW, *rPara.pResMgr ) ), + maRbEPSCompressionNone ( this, ResId( RB_EPS_COMPRESSION_NONE, *rPara.pResMgr ) ), + maFlEstimatedSize ( this, ResId( FL_ESTIMATED_SIZE, *rPara.pResMgr ) ), + maFtEstimatedSize ( this, ResId( FT_ESTIMATED_SIZE, *rPara.pResMgr ) ), + msEstimatedSizePix1 ( ResId( STR_ESTIMATED_SIZE_PIX_1, *rPara.pResMgr ) ), + msEstimatedSizePix2 ( ResId( STR_ESTIMATED_SIZE_PIX_2, *rPara.pResMgr ) ), + msEstimatedSizeVec ( ResId( STR_ESTIMATED_SIZE_VEC, *rPara.pResMgr ) ), + maFlButtons ( this, ResId( FL_BUTTONS, *rPara.pResMgr ) ), + maFbJPGPreview ( this, ResId( FB_JPG_PREVIEW, *rPara.pResMgr ) ), + maSbZoom ( this, ResId( SB_ZOOM, *rPara.pResMgr ) ), + maNfZoom ( this, ResId( NF_ZOOM, *rPara.pResMgr ) ), + maSbJPGPreviewHorz ( this, ResId( SB_JPG_PREVIEW_HORZ, *rPara.pResMgr ) ), + maSbJPGPreviewVert ( this, ResId( SB_JPG_PREVIEW_VERT, *rPara.pResMgr ) ), + maBtnOK ( this, ResId( BTN_OK, *rPara.pResMgr ) ), + maBtnCancel ( this, ResId( BTN_CANCEL, *rPara.pResMgr ) ), + maBtnHelp ( this, ResId( BTN_HELP, *rPara.pResMgr ) ), + ms1BitTreshold ( ResId( STR_1BIT_THRESHOLD, *rPara.pResMgr ) ), + ms1BitDithered ( ResId( STR_1BIT_DITHERED, *rPara.pResMgr ) ), + ms4BitGrayscale ( ResId( STR_4BIT_GRAYSCALE, *rPara.pResMgr ) ), + ms4BitColorPalette ( ResId( STR_4BIT_COLOR_PALETTE, *rPara.pResMgr ) ), + ms8BitGrayscale ( ResId( STR_8BIT_GRAYSCALE, *rPara.pResMgr ) ), + ms8BitColorPalette ( ResId( STR_8BIT_COLOR_PALETTE, *rPara.pResMgr ) ), + ms24BitColor ( ResId( STR_24BIT_TRUE_COLOR, *rPara.pResMgr ) ), + maExt ( rPara.aFilterExt ), + mnFormat ( FORMAT_UNKNOWN ), + mnMaxFilesizeForRealtimePreview( 0 ), + mpTempStream ( new SvMemoryStream() ), + maOriginalSize ( awt::Size( 0, 0 ) ), + mbPreview ( sal_False ), + mbIsPixelFormat ( bIsPixelFormat ), + mbExportSelection ( bExportSelection ), + mbPreserveAspectRatio ( sal_True ) +{ + GetGraphicSource(); + + maExt.ToUpperAscii(); + + String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Export/" ) ); + mpOptionsItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData ); + aFilterConfigPath.Append( maExt ); + mpFilterOptionsItem = new FilterConfigItem( aFilterConfigPath, &rPara.aFilterData ); + + mnInitialResolutionUnit = mbIsPixelFormat + ? mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportUnit" ) ), UNIT_DEFAULT ) + : mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "VectorExportUnit" ) ), UNIT_DEFAULT ); + + mnMaxFilesizeForRealtimePreview = mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "MaxFilesizeForRealtimePreview" ) ), 0 ); + maFtEstimatedSize.SetText( String( RTL_CONSTASCII_USTRINGPARAM( " \n " ) ) ); + + String aTitle( maExt ); + aTitle += String( ResId( DLG_EXPORT_TITLE, *mpMgr ) ); + SetText( aTitle ); + + mnFormat = GetFilterFormat( maExt ); + + Size aResolution( Application::GetDefaultDevice()->LogicToPixel( Size( 100, 100 ), MAP_CM ) ); + maResolution.Width = aResolution.Width(); + maResolution.Height= aResolution.Height(); + maOriginalSize = GetOriginalSize(); + if ( bIsPixelFormat ) + { + double fPixelsPer100thmm = static_cast< double >( maResolution.Width ) / 100000.0; + maSize = awt::Size( static_cast< sal_Int32 >( ( fPixelsPer100thmm * maOriginalSize.Width ) + 0.5 ), + static_cast< sal_Int32 >( ( fPixelsPer100thmm * maOriginalSize.Height ) + 0.5 ) ); + } + else + { + maSize = maOriginalSize; + } + + // Size + maLbSizeX.SetSelectHdl( LINK( this, ExportDialog, UpdateHdl ) ); + + maSbCompression.SetScrollHdl( LINK( this, ExportDialog, SbCompressionUpdateHdl ) ); + maNfCompression.SetModifyHdl( LINK( this, ExportDialog, UpdateHdl ) ); + + maMfSizeX.SetModifyHdl( LINK( this, ExportDialog, UpdateHdlMtfSizeX ) ); + maMfSizeY.SetModifyHdl( LINK( this, ExportDialog, UpdateHdlMtfSizeY ) ); + + maNfResolution.SetModifyHdl( LINK( this, ExportDialog, UpdateHdlNfResolution ) ); + maLbResolution.SetSelectHdl( LINK( this, ExportDialog, UpdateHdl ) ); + + maLbColorDepth.SetSelectHdl( LINK( this, ExportDialog, UpdateHdl ) ); + + maCbInterlaced.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) ); + + maCbSaveTransparency.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) ); + + maCbEPSPreviewTIFF.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) ); + maCbEPSPreviewEPSI.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) ); + + maRbEPSCompressionLZW.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) ); + maRbEPSCompressionNone.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) ); + + maRbBinary.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) ); + maRbText.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) ); + + + // JPG Preview +// maCbJPGPreview.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) ); +maCbJPGPreview.Enable( sal_False ); + + maSbJPGPreviewVert.SetScrollHdl( LINK( this, ExportDialog, UpdateHdl ) ); + maSbJPGPreviewHorz.SetScrollHdl( LINK( this, ExportDialog, UpdateHdl ) ); + maSbZoom.SetScrollHdl( LINK( this, ExportDialog, UpdateHdl ) ); + + // BMP + maCbRLEEncoding.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) ); + + // EPS + maRbEPSLevel1.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) ); + maRbEPSLevel2.SetClickHdl( LINK( this, ExportDialog, UpdateHdl ) ); + + maBtnOK.SetClickHdl( LINK( this, ExportDialog, OK ) ); + + setupLayout(); + updateControls(); + + FreeResource(); +} + +void ExportDialog::createSizeControls( vcl::RowOrColumn& rLayout ) +{ + size_t nIndex; + Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) ); + long nIndent = aBorder.Width(); + + // Size controls + rLayout.addWindow( &maFlExportSize ); + + Size aLbMax( maLbSizeX.GetSizePixel() ); + aLbMax.Width() = Max( aLbMax.Width(), maLbResolution.GetSizePixel().Width() ); + + boost::shared_ptr< vcl::LabelColumn > xSizeColumns( new vcl::LabelColumn( &rLayout ) ); + rLayout.addChild( xSizeColumns ); + + // row 1 + boost::shared_ptr< vcl::RowOrColumn > xColumn( new vcl::RowOrColumn( xSizeColumns.get(), false ) ); + xSizeColumns->addRow( &maFtSizeX, xColumn, nIndent ); + Size aMinSize( maMfSizeX.GetSizePixel() ); + nIndex = xColumn->addWindow( &maMfSizeX ); + xColumn->setMinimumSize( nIndex, aMinSize ); + nIndex = xColumn->addWindow( &maLbSizeX ); + xColumn->setMinimumSize( nIndex, aLbMax ); + + // row 2 + xColumn = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( xSizeColumns.get(), false ) ); + xSizeColumns->addRow( &maFtSizeY, xColumn, nIndent ); + nIndex = xColumn->addWindow( &maMfSizeY ); + xColumn->setMinimumSize( nIndex, aMinSize ); + nIndex = xColumn->addWindow( &maLbSizeY ); + xColumn->setMinimumSize( nIndex, aLbMax ); + + // row 3 + if ( mbIsPixelFormat ) // TODO: (metafileresolutionsupport) + { + xColumn = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( xSizeColumns.get(), false ) ); + xSizeColumns->addRow( &maFtResolution, xColumn, nIndent ); + nIndex = xColumn->addWindow( &maNfResolution ); + xColumn->setMinimumSize( nIndex, aMinSize ); + nIndex = xColumn->addWindow( &maLbResolution ); + xColumn->setMinimumSize( nIndex, aLbMax ); + } + + sal_Int32 nUnit = mnInitialResolutionUnit; + if ( nUnit == UNIT_DEFAULT ) + nUnit = GetDefaultUnit(); + + if ( !mbIsPixelFormat ) + { + maLbSizeX.RemoveEntry( UNIT_PIXEL ); // removing pixel + if ( nUnit >= UNIT_PIXEL ) + nUnit = UNIT_CM; + } + else if ( nUnit > UNIT_MAX_ID ) + nUnit = UNIT_PIXEL; + if ( nUnit < 0 ) + nUnit = UNIT_CM; + maLbSizeX.SelectEntryPos( static_cast< USHORT >( nUnit ) ); + + if ( mbIsPixelFormat ) // TODO: (metafileresolutionsupport) should be supported for vector formats also... this makes + { // sense eg for bitmap fillings in metafiles, to preserve high dpi output + // (atm without special vector support the bitmaps are rendered with 96dpi) + sal_Int32 nResolution = mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportResolution" ) ), 96 ); + if ( nResolution < 1 ) + nResolution = 96; + maNfResolution.SetValue( nResolution ); + + sal_Int32 nResolutionUnit = mpOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "PixelExportResolutionUnit" ) ), 1 ); + if ( ( nResolutionUnit < 0 ) || ( nResolutionUnit > 2 ) ) + nResolutionUnit = 1; + maLbResolution.SelectEntryPos( static_cast< USHORT >( nResolutionUnit ) ); + } + + boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) ); + rLayout.addChild( xSpacer ); +} + +void ExportDialog::createColorDepthControls( vcl::RowOrColumn& rLayout ) +{ + // Color Depth + Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) ); + long nIndent = aBorder.Width(); + + boost::shared_ptr< vcl::RowOrColumn > xRow( new vcl::RowOrColumn( &rLayout, false ) ); + rLayout.addChild( xRow ); + xRow->addWindow( &maFlColorDepth ); + + xRow = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( &rLayout, false ) ); + rLayout.addChild( xRow ); + boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) ); + xRow->addChild( xIndenter ); + boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) ); + xIndenter->setChild( xRows ); + xRows->addWindow( &maLbColorDepth ); + + boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) ); + rLayout.addChild( xSpacer ); +} + +void ExportDialog::createScrollBar( vcl::RowOrColumn& rLayout ) +{ + boost::shared_ptr< vcl::RowOrColumn > xRow( new vcl::RowOrColumn( &rLayout, false ) ); + rLayout.addChild( xRow ); + + Size aMinSize( maSbCompression.GetSizePixel() ); + size_t nIndex = xRow->addWindow( &maSbCompression ); + xRow->setMinimumSize( nIndex, aMinSize ); + aMinSize = maNfCompression.GetSizePixel(); + nIndex = xRow->addWindow( &maNfCompression ); + xRow->setMinimumSize( nIndex, aMinSize ); +} + +void ExportDialog::createFilterOptions( vcl::RowOrColumn& rLayout ) +{ + Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) ); + long nIndent = aBorder.Width(); + + switch( mnFormat ) + { + case FORMAT_JPG : + { + sal_Int32 nColor = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ColorMode" ) ), 0 ); + if ( nColor == 1 ) + nColor = 0; + else + nColor = 1; + maLbColorDepth.InsertEntry( ms8BitGrayscale ); + maLbColorDepth.InsertEntry( ms24BitColor ); + maLbColorDepth.SelectEntryPos( nColor ); + createColorDepthControls( maLayout ); + + rLayout.addWindow( &maFlJPGQuality ); + + // Quality + boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) ); + rLayout.addChild( xIndenter ); + boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) ); + xIndenter->setChild( xRows ); + createScrollBar( *xRows.get() ); + xRows->addWindow( &maFtJPGMin ); + xRows->addWindow( &maFtJPGMax ); + if ( maCbJPGPreview.IsEnabled() ) + xRows->addWindow( &maCbJPGPreview ); + + boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) ); + rLayout.addChild( xSpacer ); + + sal_Int32 nQuality = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Quality" ) ), 75 ); + if ( ( nQuality < 1 ) || ( nQuality > 100 ) ) + nQuality = 75; + + maSbCompression.SetRangeMin( 1 ); + maSbCompression.SetRangeMax( 100 ); + maNfCompression.SetMin( 1 ); + maNfCompression.SetMax( 100 ); + maNfCompression.SetValue( nQuality ); + maNfCompression.SetStrictFormat( sal_True ); + if ( maCbJPGPreview.IsEnabled() ) + maCbJPGPreview.Check( sal_False ); + } + break; + case FORMAT_PNG : + { + rLayout.addWindow( &maFlCompression ); + + // Compression 1..9 + boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) ); + rLayout.addChild( xIndenter ); + boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) ); + xIndenter->setChild( xRows ); + createScrollBar( *xRows.get() ); + xRows->addWindow( &maFtPNGMin ); + xRows->addWindow( &maFtPNGMax ); + boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) ); + rLayout.addChild( xSpacer ); + + // Interlaced + rLayout.addWindow( &maFlMode ); + xIndenter.reset( new vcl::Indenter( &rLayout, nIndent ) ); + rLayout.addChild( xIndenter ); + xRows.reset( new vcl::RowOrColumn( &rLayout, true ) ); + xIndenter->setChild( xRows ); + xRows->addWindow( &maCbInterlaced ); + + xSpacer.reset( new vcl::Spacer( &rLayout, 2 ) ); + rLayout.addChild( xSpacer ); + + sal_Int32 nCompression = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Compression" ) ), 6 ); + if ( ( nCompression < 1 ) || ( nCompression > 9 ) ) + nCompression = 6; + maSbCompression.SetRangeMin( 1 ); + maSbCompression.SetRangeMax( 9 ); + maNfCompression.SetMin( 1 ); + maNfCompression.SetMax( 9 ); + maNfCompression.SetValue( 9 ); + maNfCompression.SetStrictFormat( sal_True ); + + maCbInterlaced.Check( mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), 0 ) != 0 ); + } + break; + case FORMAT_BMP : + { + sal_Int32 nColor = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Color" ) ), 0 ); + if ( nColor == 0 ) + nColor = 6; + else + nColor--; + maLbColorDepth.InsertEntry( ms1BitTreshold ); + maLbColorDepth.InsertEntry( ms1BitDithered ); + maLbColorDepth.InsertEntry( ms4BitGrayscale ); + maLbColorDepth.InsertEntry( ms4BitColorPalette ); + maLbColorDepth.InsertEntry( ms8BitGrayscale ); + maLbColorDepth.InsertEntry( ms8BitColorPalette ); + maLbColorDepth.InsertEntry( ms24BitColor ); + maLbColorDepth.SelectEntryPos( nColor ); + createColorDepthControls( maLayout ); + + rLayout.addWindow( &maFlCompression ); + // RLE coding + boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) ); + rLayout.addChild( xIndenter ); + boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) ); + xIndenter->setChild( xRows ); + xRows->addWindow( &maCbRLEEncoding ); + boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) ); + rLayout.addChild( xSpacer ); + + maCbRLEEncoding.Check( mpFilterOptionsItem->ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "RLE_Coding" ) ), sal_True ) ); + } + break; + case FORMAT_GIF : + { + rLayout.addWindow( &maFlMode ); + boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) ); + rLayout.addChild( xIndenter ); + boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) ); + xIndenter->setChild( xRows ); + xRows->addWindow( &maCbInterlaced ); + boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) ); + rLayout.addChild( xSpacer ); + + rLayout.addWindow( &maFlGIFDrawingObjects ); + xIndenter = boost::shared_ptr< vcl::Indenter >( new vcl::Indenter( &rLayout, nIndent ) ); + rLayout.addChild( xIndenter ); + xRows = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( &rLayout, true ) ); + xIndenter->setChild( xRows ); + xRows->addWindow( &maCbSaveTransparency ); + xSpacer.reset( new vcl::Spacer( &rLayout, 2 ) ); + rLayout.addChild( xSpacer ); + + maCbInterlaced.Check( mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Interlaced" ) ), 1 ) != 0 ); + maCbSaveTransparency.Check( mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Translucent" ) ), 1 ) != 0 ); + } + break; + case FORMAT_PBM : + case FORMAT_PGM : + case FORMAT_PPM : + { + rLayout.addWindow( &maFlJPGQuality ); + + // RB Binary / Text + boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( &rLayout, nIndent ) ); + rLayout.addChild( xIndenter ); + boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( &rLayout, true ) ); + xIndenter->setChild( xRows ); + xRows->addWindow( &maRbBinary ); + xRows->addWindow( &maRbText ); + boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) ); + rLayout.addChild( xSpacer ); + + sal_Int32 nFormat = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "FileFormat" ) ), 1 ); + maRbBinary.Check( nFormat == 0 ); + maRbText.Check( nFormat != 0 ); + } + break; + case FORMAT_EPS : + { + boost::shared_ptr< vcl::RowOrColumn > xColumns( new vcl::RowOrColumn( &rLayout, false ) ); + rLayout.addChild( xColumns ); + boost::shared_ptr< vcl::RowOrColumn > xLeft( new vcl::RowOrColumn( &rLayout, true ) ); + xColumns->addChild( xLeft ); + + xLeft->addWindow( &maFlEPSPreview ); + boost::shared_ptr< vcl::Indenter > xIndenter( new vcl::Indenter( xLeft.get(), nIndent ) ); + xLeft->addChild( xIndenter ); + boost::shared_ptr< vcl::RowOrColumn > xRows( new vcl::RowOrColumn( xLeft.get(), true ) ); + xIndenter->setChild( xRows ); + xRows->addWindow( &maCbEPSPreviewTIFF ); + xRows->addWindow( &maCbEPSPreviewEPSI ); + boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( xLeft.get(), 2 ) ); + xLeft->addChild( xSpacer ); + + xLeft->addWindow( &maFlEPSVersion ); + xIndenter = boost::shared_ptr< vcl::Indenter >( new vcl::Indenter( xLeft.get(), nIndent ) ); + xLeft->addChild( xIndenter ); + xRows = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( xLeft.get(), true ) ); + xIndenter->setChild( xRows ); + xRows->addWindow( &maRbEPSLevel1 ); + xRows->addWindow( &maRbEPSLevel2 ); + xSpacer.reset( new vcl::Spacer( xLeft.get(), 2 ) ); + xLeft->addChild( xSpacer ); + + boost::shared_ptr< vcl::RowOrColumn > xRight( new vcl::RowOrColumn( &rLayout, true ) ); + xColumns->addChild( xRight ); + + xRight->addWindow( &maFlEPSColorFormat ); + xIndenter = boost::shared_ptr< vcl::Indenter >( new vcl::Indenter( xRight.get(), nIndent ) ); + xRight->addChild( xIndenter ); + xRows = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( xRight.get(), true ) ); + xIndenter->setChild( xRows ); + xRows->addWindow( &maRbEPSColorFormat1 ); + xRows->addWindow( &maRbEPSColorFormat2 ); + xSpacer.reset( new vcl::Spacer( xRight.get(), 2 ) ); + xRight->addChild( xSpacer ); + + xRight->addWindow( &maFlCompression ); + xIndenter = boost::shared_ptr< vcl::Indenter >( new vcl::Indenter( xRight.get(), nIndent ) ); + xRight->addChild( xIndenter ); + xRows = boost::shared_ptr< vcl::RowOrColumn >( new vcl::RowOrColumn( xRight.get(), true ) ); + xIndenter->setChild( xRows ); + xRows->addWindow( &maRbEPSCompressionLZW ); + xRows->addWindow( &maRbEPSCompressionNone ); + + xSpacer.reset( new vcl::Spacer( &rLayout, 2 ) ); + rLayout.addChild( xSpacer ); + + sal_Int32 nPreview = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Preview" ) ), 0 ); + sal_Int32 nVersion = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ), 2 ); + sal_Int32 nColor = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ColorFormat" ) ), 0 ); + sal_Int32 nCompr = mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "CompressionMode" ) ), 2 ); + + mpFilterOptionsItem->ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "TextMode" ) ), 0 ); + + maCbEPSPreviewTIFF.Check( ( nPreview & 1 ) != 0 ); + maCbEPSPreviewEPSI.Check( ( nPreview & 2 ) != 0 ); + + maRbEPSLevel1.Check( nVersion == 1 ); + maRbEPSLevel2.Check( nVersion == 2 ); + + maRbEPSColorFormat1.Check( nColor == 1 ); + maRbEPSColorFormat2.Check( nColor != 1 ); + + maRbEPSCompressionLZW.Check( nCompr == 1 ); + maRbEPSCompressionNone.Check( nCompr != 1 ); + } + break; + } +} + +void ExportDialog::createButtons( vcl::RowOrColumn& rLayout ) +{ + rLayout.addWindow( &maFlButtons ); + boost::shared_ptr< vcl::Spacer > xSpacer( new vcl::Spacer( &rLayout, 2 ) ); + rLayout.addChild( xSpacer ); + + Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) ); + + boost::shared_ptr< vcl::RowOrColumn > xButtons( new vcl::RowOrColumn( &rLayout, false ) ); + size_t nIndex = rLayout.addChild( xButtons ); + rLayout.setBorders( nIndex, aBorder.Width(), 0, aBorder.Width(), aBorder.Width() ); + + Size aMinSize( maBtnCancel.GetSizePixel() ); + // insert help button + xButtons->setMinimumSize( xButtons->addWindow( &maBtnHelp ), aMinSize ); + + // insert a spacer, cancel and OK buttons are right aligned + + xSpacer.reset( new vcl::Spacer( xButtons.get(), 2 ) ); + xButtons->addChild( xSpacer ); + xButtons->setMinimumSize( xButtons->addWindow( &maBtnOK ), aMinSize ); + xButtons->setMinimumSize( xButtons->addWindow( &maBtnCancel ), aMinSize ); +} + +void ExportDialog::setupLayout() +{ + Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) ); + maLayout.setParentWindow( this ); + maLayout.setOuterBorder( aBorder.Width() ); + + createSizeControls( maLayout ); + createFilterOptions( maLayout ); + + if ( mnMaxFilesizeForRealtimePreview || mbIsPixelFormat ) + { + maLayout.addWindow( &maFlEstimatedSize ); + maLayout.addWindow( &maFtEstimatedSize ); + } + createButtons( maLayout ); + + maLayout.show(); + maDialogSize = maLayout.getOptimalSize( WINDOWSIZE_PREFERRED ); + maLayout.setManagedArea( Rectangle( Point(), maDialogSize ) ); + SetOutputSizePixel( Size( mbPreview ? maDialogSize.Width() * 2 : maDialogSize.Width(), maDialogSize.Height() ) ); + + maRectFlButtons = Rectangle( maFlButtons.GetPosPixel(), maFlButtons.GetSizePixel() ); + maRectBtnHelp = Rectangle( maBtnHelp.GetPosPixel(), maBtnHelp.GetSizePixel() ); + maRectBtnOK = Rectangle( maBtnOK.GetPosPixel(), maBtnOK.GetSizePixel() ); + maRectBtnCancel = Rectangle( maBtnCancel.GetPosPixel(), maBtnOK.GetSizePixel() ); + + maLbSizeY.Hide(); +} + +static rtl::OUString ImpValueOfInKB( const sal_Int64& rVal ) +{ + double fVal( static_cast<double>( rVal ) ); + fVal /= ( 1 << 10 ); + fVal += 0.05; + rtl::OUStringBuffer aVal( rtl::OUString::valueOf( fVal ) ); + sal_Int32 nX( rtl::OUString( aVal.getStr() ).indexOf( '.', 0 ) ); + if ( nX > 0 ) + aVal.setLength( nX + 2 ); + return aVal.makeStringAndClear(); +} + +sal_Int32 static GetZoomValueFromThumbPos( sal_Int32 nThumbPos ) +{ + sal_Int32 nProz = 0; + if ( nThumbPos <= 50 ) + nProz = nThumbPos * 2; // so a range of 50 represents 100% + else + nProz = ( ( nThumbPos - 50 ) * 60 ) + 100; // we want to scale up to 3000% + return nProz; +} + +void ExportDialog::updatePreview() +{ + // JPG +// maCbJPGPreview.Enable( IsTempExportAvailable() ); + +// if ( maCbJPGPreview.IsEnabled() && maCbJPGPreview.IsChecked() ) + if ( mbPreview ) + { + long nScrollBarSize = Application::GetSettings().GetStyleSettings().GetScrollBarSize(); + + Point aPreviewPos( maDialogSize.Width(), 0 ); + Size aPreviewSize( maDialogSize.Width(), maFlButtons.GetPosPixel().Y() ); + + Point aFixedBitmapPos( aPreviewPos ); + Size aFixedBitmapSize( aPreviewSize ); + + maSbZoom.Show( sal_False ); + maSbZoom.SetPosPixel( Point( aPreviewPos.X(), aPreviewPos.Y() ) ); + maSbZoom.SetSizePixel( Size( aPreviewSize.Width() / 4, nScrollBarSize ) ); + maNfZoom.Show( sal_False ); + maNfZoom.SetPosPixel( Point( aPreviewPos.X() + aPreviewSize.Width() / 4, aPreviewPos.Y() ) ); + maNfZoom.SetSizePixel( Size( aPreviewSize.Width() / 6, nScrollBarSize ) ); + maNfZoom.SetValue( GetZoomValueFromThumbPos( maSbZoom.GetThumbPos() ) ); + maFbJPGPreview.Show( sal_True ); + + sal_Int32 nZoom = GetZoomValueFromThumbPos( maSbZoom.GetThumbPos() ); + double fSizePixelX = static_cast< double >( maSize.Width * nZoom ) / 100.0; + double fSizePixelY = static_cast< double >( maSize.Height * nZoom ) / 100.0; + + double fXRatio = fSizePixelX / maSize.Width; // the size of each pixel + double fYRatio = fSizePixelY / maSize.Height; + + sal_Bool bHorzSb = fSizePixelX > aFixedBitmapSize.Width(); + sal_Bool bVertSb = fSizePixelY > aFixedBitmapSize.Height(); + if ( bHorzSb ) + { + aFixedBitmapSize.Height() -= nScrollBarSize; + + maSbJPGPreviewHorz.Show( sal_True ); + maSbJPGPreviewHorz.SetPosPixel( Point( aFixedBitmapPos.X(), aFixedBitmapPos.Y() + aFixedBitmapSize.Height() ) ); + maSbJPGPreviewHorz.SetSizePixel( Size( aFixedBitmapSize.Width(), nScrollBarSize ) ); + } + else + { + maSbJPGPreviewHorz.Show( sal_False ); + } + + + if ( bVertSb ) + { + aFixedBitmapSize.Width() -= nScrollBarSize; + + maSbJPGPreviewVert.Show( sal_True ); + maSbJPGPreviewVert.SetPosPixel( Point( aFixedBitmapPos.X() + aFixedBitmapSize.Width(), aFixedBitmapPos.Y() ) ); + maSbJPGPreviewVert.SetSizePixel( Size( nScrollBarSize, aFixedBitmapSize.Height() ) ); + } + else + { + maSbJPGPreviewVert.Show( sal_False ); + } + + Point aPos( 0, 0 ); + Size aSize; + if ( fXRatio > 1.0 ) + { + aSize.Width() = maSize.Width > aFixedBitmapSize.Width() ? maSize.Width : aFixedBitmapSize.Width(); + aSize.Width() /= static_cast<long int>(fXRatio); + } + else + { + aSize.Width() = maSize.Width < aFixedBitmapSize.Width() ? maSize.Width : aFixedBitmapSize.Width(); + aSize.Width() /= static_cast<long int>(fXRatio); + } + + if ( fYRatio > 1.0 ) + { + aSize.Height() = maSize.Height > aFixedBitmapSize.Height() ? maSize.Height : aFixedBitmapSize.Height(); + aSize.Height() /= static_cast<long int>(fYRatio); + } + else + { + aSize.Height() = maSize.Height < aFixedBitmapSize.Height() ? maSize.Height : aFixedBitmapSize.Height(); + aSize.Height() /= static_cast<long int>(fYRatio); + } + + if ( aSize.Width() < maSize.Width ) + { + sal_Int32 nXDiff = static_cast< sal_Int32 >( ( ( ( maSize.Width - aSize.Width() ) * maSbJPGPreviewHorz.GetThumbPos() ) / 100.0 ) ); + aPos.X() += nXDiff; + } + if ( aSize.Height() < maSize.Height ) + { + sal_Int32 nYDiff = static_cast< sal_Int32 >( ( ( ( maSize.Height - aSize.Height() ) * maSbJPGPreviewVert.GetThumbPos() ) / 100.0 ) ); + aPos.Y() += nYDiff; + } + + Bitmap aCroppedBitmap( maBitmap ); + aCroppedBitmap.Crop( Rectangle( aPos, aSize ) ); + aSize = aCroppedBitmap.GetSizePixel(); + aSize = Size( static_cast<long int>(aSize.Width() * fXRatio), static_cast<long int>(aSize.Height() * fYRatio) ); + aCroppedBitmap.Scale( aSize ); + + if ( aSize.Width() > aFixedBitmapSize.Width() ) + aSize.Width() = aFixedBitmapSize.Width(); + if ( aSize.Height() > aFixedBitmapSize.Height() ) + aSize.Height() = aFixedBitmapSize.Height(); + Point aPoint( aFixedBitmapPos ); + if ( aSize.Width() < aFixedBitmapSize.Width() ) + aPoint.X() += ( aFixedBitmapSize.Width() - aSize.Width() ) / 2; + if ( aSize.Height() < aFixedBitmapSize.Height() ) + aPoint.Y() += ( aFixedBitmapSize.Height() - aSize.Height() ) / 2; + + maFbJPGPreview.SetPosPixel( aPoint ); + maFbJPGPreview.SetSizePixel( aSize ); + maFbJPGPreview.SetBitmap( aCroppedBitmap ); + + SetOutputSizePixel( Size( maDialogSize.Width() * 2, maDialogSize.Height() ) ); + + maFlButtons.SetSizePixel( Size( maRectFlButtons.GetWidth() * 2, maRectFlButtons.GetHeight() ) ); + maBtnHelp.SetPosPixel( Point( maRectBtnHelp.Left() + maDialogSize.Width(), maRectBtnHelp.Top() ) ); + maBtnOK.SetPosPixel( Point( maRectBtnOK.Left() + maDialogSize.Width(), maRectBtnOK.Top() ) ); + maBtnCancel.SetPosPixel( Point( maRectBtnCancel.Left() + maDialogSize.Width(), maRectBtnCancel.Top() ) ); + } + else + { + maSbZoom.Show( sal_False ); + maNfZoom.Show( sal_False ); + maFbJPGPreview.Show( sal_False ); + maSbJPGPreviewHorz.Show( sal_False ); + maSbJPGPreviewVert.Show( sal_False ); + + SetOutputSizePixel( maDialogSize ); + + maFlButtons.SetSizePixel( Size( maRectFlButtons.GetWidth(), maRectFlButtons.GetHeight() ) ); + maBtnHelp.SetPosPixel( Point( maRectBtnHelp.Left(), maRectBtnHelp.Top() ) ); + maBtnOK.SetPosPixel( Point( maRectBtnOK.Left(), maRectBtnOK.Top() ) ); + maBtnCancel.SetPosPixel( Point( maRectBtnCancel.Left(), maRectBtnCancel.Top() ) ); + } +} + +void ExportDialog::updateControls() +{ + GetGraphicStream(); + + // Size Controls + if ( !mbIsPixelFormat ) + { + awt::Size aSize100thmm( maSize ); + Size aSize( LogicToLogic( Size( aSize100thmm.Width * 100, aSize100thmm.Height * 100 ), MAP_100TH_MM, + MapMode( GetMapUnit( maLbSizeX.GetSelectEntryPos() ) ) ) ); + maMfSizeX.SetValue( aSize.Width() ); + maMfSizeY.SetValue( aSize.Height() ); + } + else + { + MapUnit aMapUnit( GetMapUnit( maLbSizeX.GetSelectEntryPos() ) ); + if ( aMapUnit == MAP_PIXEL ) + { // calculating pixel count via resolution and original graphic size + maMfSizeX.SetDecimalDigits( 0 ); + maMfSizeY.SetDecimalDigits( 0 ); + maMfSizeX.SetValue( maSize.Width ); + maMfSizeY.SetValue( maSize.Height ); + } + else + { + maMfSizeX.SetDecimalDigits( 2 ); + maMfSizeY.SetDecimalDigits( 2 ); + double fRatio; + switch( GetMapUnit( maLbSizeX.GetSelectEntryPos() ) ) + { + case MAP_INCH : fRatio = static_cast< double >( maResolution.Width ) * 0.0254; break; + case MAP_MM : fRatio = static_cast< double >( maResolution.Width ) * 0.001; break; + case MAP_POINT :fRatio = ( static_cast< double >( maResolution.Width ) * 0.0254 ) / 72.0; break; + default: + case MAP_CM : fRatio = static_cast< double >( maResolution.Width ) * 0.01; break; + } + maMfSizeX.SetValue( static_cast< sal_Int32 >( ( static_cast< double >( maSize.Width * 100 ) / fRatio ) + 0.5 ) ); + maMfSizeY.SetValue( static_cast< sal_Int32 >( ( static_cast< double >( maSize.Height * 100 ) / fRatio ) + 0.5 ) ); + } + } + sal_Int32 nResolution = 0; + switch( maLbResolution.GetSelectEntryPos() ) + { + case 0 : nResolution = maResolution.Width / 100; break; // pixels / cm + case 2 : nResolution = maResolution.Width; break; // pixels / meter + default: + case 1 : nResolution = static_cast< sal_Int32 >(maResolution.Width * 0.0254); break; // pixels / inch + } + maNfResolution.SetValue( nResolution ); + + if ( maSbCompression.IsVisible() ) + maSbCompression.SetThumbPos( maNfCompression.GetValue() ); + + // updating estimated size + sal_Int64 nRealFileSize( mpTempStream->Tell() ); + if ( mbIsPixelFormat ) + { + String aEst( nRealFileSize ? msEstimatedSizePix2 : msEstimatedSizePix1 ); + sal_Int64 nRawFileSize( GetRawFileSize() ); + xub_StrLen nInd = aEst.Search( '%' ); + aEst.Replace( nInd, 2, ImpValueOfInKB( nRawFileSize ) ); + + if ( nRealFileSize ) + { + nInd = aEst.Search( '%', nInd ); + aEst.Replace( nInd, 2, ImpValueOfInKB( nRealFileSize ) ); + } + maFtEstimatedSize.SetText( aEst ); + } + else + { + if ( mnMaxFilesizeForRealtimePreview ) + { + String aEst( msEstimatedSizeVec ); + xub_StrLen nInd = aEst.Search( '%', 0 ); + aEst.Replace( nInd, 2, ImpValueOfInKB( nRealFileSize ) ); + maFtEstimatedSize.SetText( aEst ); + } + } + updatePreview(); + + // EPS + if ( maRbEPSLevel1.IsVisible() ) + { + sal_Bool bEnabled = maRbEPSLevel1.IsChecked() == sal_False; + maRbEPSColorFormat1.Enable( bEnabled ); + maRbEPSColorFormat2.Enable( bEnabled ); + maRbEPSCompressionLZW.Enable( bEnabled ); + maRbEPSCompressionNone.Enable( bEnabled ); + } +} + +ExportDialog::~ExportDialog() +{ + delete mpFilterOptionsItem; + delete mpOptionsItem; +} + + +/************************************************************************* +|* +|* Speichert eingestellte Werte in ini-Datei +|* +\************************************************************************/ +IMPL_LINK( ExportDialog, UpdateHdl, void *, EMPTYARG ) +{ + updateControls(); + return 0; +} + +IMPL_LINK( ExportDialog, UpdateHdlMtfSizeX, void *, EMPTYARG ) +{ + double fRatio = static_cast< double >( maOriginalSize.Height ) / maOriginalSize.Width; + + if ( mbIsPixelFormat ) + { + switch( GetMapUnit( maLbSizeX.GetSelectEntryPos() ) ) + { + case MAP_INCH : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.0254 * maMfSizeX.GetValue() / 100.0 + 0.5 ); break; + case MAP_CM : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.01 * maMfSizeX.GetValue() / 100.0 + 0.5 ); break; + case MAP_MM : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.001 * maMfSizeX.GetValue() / 100.0 + 0.5 ); break; + case MAP_POINT : maSize.Width = static_cast< sal_Int32 >( static_cast< double >( maResolution.Width ) * 0.0254 * maMfSizeX.GetValue() / 100.0 * 72 + 0.5 ); break; + default: + case MAP_PIXEL : maSize.Width = maMfSizeX.GetValue(); break; + } + maSize.Height = static_cast< sal_Int32 >( fRatio * maSize.Width + 0.5 ); + } + else + { + Fraction aFract( 1, 100 ); + sal_Int32 nWidth = maMfSizeX.GetValue(); + sal_Int32 nHeight= static_cast< sal_Int32 >( nWidth * fRatio ); + const Size aSource( static_cast< sal_Int32 >( nWidth ), static_cast< sal_Int32 >( nHeight ) ); + MapMode aSourceMapMode( GetMapUnit( maLbSizeX.GetSelectEntryPos() ),Point(), aFract, aFract ); + Size aDest( LogicToLogic( aSource, aSourceMapMode, MAP_100TH_MM ) ); + + maSize.Width = aDest.Width(); + if ( mbPreserveAspectRatio ) + maSize.Height = aDest.Height(); + } + updateControls(); + return 0; +} + +IMPL_LINK( ExportDialog, UpdateHdlMtfSizeY, void *, EMPTYARG ) +{ + double fRatio = static_cast< double >( maOriginalSize.Width ) / maOriginalSize.Height; + + if ( mbIsPixelFormat ) + { + switch( GetMapUnit( maLbSizeX.GetSelectEntryPos() ) ) + { + case MAP_INCH : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.0254 * maMfSizeY.GetValue() / 100.0 + 0.5 ); break; + case MAP_CM : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.01 * maMfSizeY.GetValue() / 100.0 + 0.5 ); break; + case MAP_MM : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.001 * maMfSizeY.GetValue() / 100.0 + 0.5 ); break; + case MAP_POINT : maSize.Height = static_cast< sal_Int32 >( static_cast< double >( maResolution.Height ) * 0.0254 * maMfSizeY.GetValue() / 100.0 * 72 + 0.5 ); break; + default: + case MAP_PIXEL : maSize.Height = maMfSizeY.GetValue(); break; + } + maSize.Width = static_cast< sal_Int32 >( fRatio * maSize.Height + 0.5 ); + } + else + { + Fraction aFract( 1, 100 ); + sal_Int32 nHeight= maMfSizeY.GetValue(); + sal_Int32 nWidth = static_cast< sal_Int32 >( nHeight * fRatio ); + const Size aSource( static_cast< sal_Int32 >( nWidth ), static_cast< sal_Int32 >( nHeight ) ); + MapMode aSourceMapMode( GetMapUnit( maLbSizeX.GetSelectEntryPos() ),Point(), aFract, aFract ); + Size aDest( LogicToLogic( aSource, aSourceMapMode, MAP_100TH_MM ) ); + + maSize.Height = aDest.Height(); + if ( mbPreserveAspectRatio ) + maSize.Width = aDest.Width(); + } + updateControls(); + return 0; +} + +IMPL_LINK( ExportDialog, UpdateHdlNfResolution, void *, EMPTYARG ) +{ + sal_Int32 nResolution = maNfResolution.GetValue(); + if ( maLbResolution.GetSelectEntryPos() == 0 ) // pixels / cm + nResolution *= 100; + else if ( maLbResolution.GetSelectEntryPos() == 1 ) // pixels / inch + nResolution = static_cast< sal_Int32 >( ( ( static_cast< double >( nResolution ) + 0.5 ) / 0.0254 ) ); + maResolution.Width = nResolution; + maResolution.Height= nResolution; + + updateControls(); + return 0; +} + +IMPL_LINK( ExportDialog, SbCompressionUpdateHdl, void *, EMPTYARG ) +{ + maNfCompression.SetValue( maSbCompression.GetThumbPos() ); + updateControls(); + return 0; +} + +IMPL_LINK( ExportDialog, OK, void *, EMPTYARG ) +{ + // writing config parameter + + + mrFltCallPara.aFilterData = GetFilterData( sal_True ); + EndDialog( RET_OK ); + + return 0; +} + diff --git a/svtools/source/filter.vcl/filter/exportdialog.hrc b/svtools/source/filter.vcl/filter/exportdialog.hrc new file mode 100644 index 000000000000..e230bcd2c5c3 --- /dev/null +++ b/svtools/source/filter.vcl/filter/exportdialog.hrc @@ -0,0 +1,99 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#include <svtools/svtools.hrc> + +#define BTN_OK 1 +#define BTN_CANCEL 1 +#define BTN_HELP 1 + +#define FL_EXPORT_SIZE 1 +#define FL_COLOR_DEPTH 2 +#define FL_JPG_QUALITY 3 +#define FL_COMPRESSION 4 +#define FL_MODE 5 +#define FL_GIF_DRAWING_OBJECTS 6 +#define FL_PBM_OPTIONS 7 +#define FL_EPS_PREVIEW 8 +#define FL_EPS_VERSION 9 +#define FL_EPS_COLOR_FORMAT 10 +#define FL_ESTIMATED_SIZE 11 +#define FL_BUTTONS 12 + +#define FT_SIZEX 1 +#define FT_SIZEY 2 +#define FT_RESOLUTION 3 +#define FT_JPG_MIN 4 +#define FT_JPG_MAX 5 +#define FT_PNG_MIN 6 +#define FT_PNG_MAX 7 +#define FT_ESTIMATED_SIZE 8 + +#define NF_RESOLUTION 1 +#define NF_COMPRESSION 2 +#define NF_ZOOM 3 + +#define MF_SIZEX 1 +#define MF_SIZEY 2 + +#define LB_SIZEX 1 +#define LB_SIZEY 2 +#define LB_RESOLUTION 3 +#define LB_COLOR_DEPTH 4 + +#define RB_BINARY 1 +#define RB_TEXT 2 +#define RB_EPS_LEVEL1 3 +#define RB_EPS_LEVEL2 4 +#define RB_EPS_COLOR_FORMAT1 5 +#define RB_EPS_COLOR_FORMAT2 6 +#define RB_EPS_COMPRESSION_LZW 7 +#define RB_EPS_COMPRESSION_NONE 8 + +#define CB_JPG_PREVIEW 1 +#define CB_INTERLACED 2 +#define CB_RLE_ENCODING 3 +#define CB_SAVE_TRANSPARENCY 4 +#define CB_EPS_PREVIEW_TIFF 5 +#define CB_EPS_PREVIEW_EPSI 6 + +#define FB_JPG_PREVIEW 1 + +#define SB_COMPRESSION 1 +#define SB_JPG_PREVIEW_HORZ 2 +#define SB_JPG_PREVIEW_VERT 3 +#define SB_ZOOM 4 + +#define STR_1BIT_THRESHOLD 1 +#define STR_1BIT_DITHERED 2 +#define STR_4BIT_GRAYSCALE 3 +#define STR_4BIT_COLOR_PALETTE 4 +#define STR_8BIT_GRAYSCALE 5 +#define STR_8BIT_COLOR_PALETTE 6 +#define STR_24BIT_TRUE_COLOR 7 +#define STR_ESTIMATED_SIZE_PIX_1 8 +#define STR_ESTIMATED_SIZE_PIX_2 9 +#define STR_ESTIMATED_SIZE_VEC 10 diff --git a/svtools/source/filter.vcl/filter/exportdialog.hxx b/svtools/source/filter.vcl/filter/exportdialog.hxx new file mode 100644 index 000000000000..20a9ac3ea832 --- /dev/null +++ b/svtools/source/filter.vcl/filter/exportdialog.hxx @@ -0,0 +1,216 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef _EXPORTDIALOG_HXX_ +#define _EXPORTDIALOG_HXX_ + +#include <svtools/fltcall.hxx> +#include <vcl/dialog.hxx> +#include <vcl/button.hxx> +#include <vcl/fixed.hxx> +#include <vcl/field.hxx> +#include <vcl/lstbox.hxx> +#include <vcl/msgbox.hxx> +#include <vcl/arrange.hxx> +#include <vcl/scrbar.hxx> +#include <com/sun/star/document/XExporter.hpp> +#include <com/sun/star/drawing/XShape.hpp> +#include <com/sun/star/drawing/XShapes.hpp> +#include <com/sun/star/drawing/XDrawPage.hpp> + +/************************************************************************* +|* +|* Dialog zum Einstellen von Filteroptionen bei Pixelformaten +|* +\************************************************************************/ + +class FilterConfigItem; +class ExportDialog : public ModalDialog +{ +private: + + FltCallDialogParameter& + mrFltCallPara; + + ResMgr* mpMgr; + + const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > + mxMgr; + const com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& + mxSourceDocument; + + FixedLine maFlExportSize; + FixedText maFtSizeX; + MetricField maMfSizeX; + ListBox maLbSizeX; + FixedText maFtSizeY; + MetricField maMfSizeY; + ListBox maLbSizeY; + FixedText maFtResolution; + NumericField maNfResolution; + ListBox maLbResolution; + FixedLine maFlColorDepth; + ListBox maLbColorDepth; + FixedLine maFlJPGQuality; + FixedLine maFlMode; + FixedLine maFlPBMOptions; + ScrollBar maSbCompression; + NumericField maNfCompression; + FixedText maFtJPGMin; + FixedText maFtJPGMax; + FixedText maFtPNGMin; + FixedText maFtPNGMax; + CheckBox maCbJPGPreview; + CheckBox maCbInterlaced; + CheckBox maCbRLEEncoding; + FixedLine maFlGIFDrawingObjects; + CheckBox maCbSaveTransparency; + RadioButton maRbBinary; + RadioButton maRbText; + FixedLine maFlEPSPreview; + CheckBox maCbEPSPreviewTIFF; + CheckBox maCbEPSPreviewEPSI; + FixedLine maFlEPSVersion; + RadioButton maRbEPSLevel1; + RadioButton maRbEPSLevel2; + FixedLine maFlEPSColorFormat; + RadioButton maRbEPSColorFormat1; + RadioButton maRbEPSColorFormat2; + FixedLine maFlCompression; + RadioButton maRbEPSCompressionLZW; + RadioButton maRbEPSCompressionNone; + FixedLine maFlEstimatedSize; + FixedText maFtEstimatedSize; + String msEstimatedSizePix1; + String msEstimatedSizePix2; + String msEstimatedSizeVec; + FixedLine maFlButtons; + FixedBitmap maFbJPGPreview; + ScrollBar maSbZoom; + NumericField maNfZoom; + ScrollBar maSbJPGPreviewHorz; + ScrollBar maSbJPGPreviewVert; + OKButton maBtnOK; + CancelButton maBtnCancel; + HelpButton maBtnHelp; + + String ms1BitTreshold; + String ms1BitDithered; + String ms4BitGrayscale; + String ms4BitColorPalette; + String ms8BitGrayscale; + String ms8BitColorPalette; + String ms24BitColor; + + vcl::RowOrColumn maLayout; + Size maDialogSize; + + FilterConfigItem* mpOptionsItem; + FilterConfigItem* mpFilterOptionsItem; + + String maExt; + String maEstimatedSizeText; + sal_Int16 mnFormat; + sal_Int32 mnMaxFilesizeForRealtimePreview; + + Rectangle maRectFlButtons; + Rectangle maRectBtnHelp; + Rectangle maRectBtnOK; + Rectangle maRectBtnCancel; + + SvStream* mpTempStream; + Bitmap maBitmap; + + com::sun::star::awt::Size + maOriginalSize; // the original graphic size in 1/100mm + com::sun::star::awt::Size + maSize; // for vector graphics it always contains the logical size in 1/100mm + + sal_Bool mbPreview; + sal_Bool mbIsPixelFormat; + sal_Bool mbExportSelection; + sal_Bool mbPreserveAspectRatio; + + sal_Int32 mnInitialResolutionUnit; + + // for pixel graphics it always contains the pixel count + com::sun::star::awt::Size + maResolution; // it always contains the number of pixels per meter + + com::sun::star::uno::Reference< com::sun::star::drawing::XShape > + mxShape; + com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > + mxShapes; + com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > + mxPage; + + + DECL_LINK( UpdateHdl,void* p ); + DECL_LINK( UpdateHdlMtfSizeX,void* p ); + DECL_LINK( UpdateHdlMtfSizeY,void* p ); + DECL_LINK( UpdateHdlNfResolution,void* p ); + DECL_LINK( SbCompressionUpdateHdl,void* p ); + DECL_LINK( NfCompressionUpdateHdlX,void* p ); + + DECL_LINK( OK, void* p ); + + void createSizeControls( vcl::RowOrColumn& ); + void createColorDepthControls( vcl::RowOrColumn& ); + void createFilterOptions( vcl::RowOrColumn& ); + void createButtons( vcl::RowOrColumn& ); + void createScrollBar( vcl::RowOrColumn& ); + void setupLayout(); + void updatePreview(); + void updateControls(); + + void GetGraphicSource(); + sal_Bool GetGraphicStream(); + Bitmap GetGraphicBitmap( SvStream& rStream ); + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > + GetFilterData( sal_Bool bUpdateConfig ); + + sal_uInt32 GetRawFileSize() const; + sal_Bool IsTempExportAvailable() const; + + com::sun::star::awt::Size + GetOriginalSize(); + + sal_Int32 GetDefaultUnit(); + +public: + ExportDialog( FltCallDialogParameter& rPara, + const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > rxMgr, + const com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& rxSourceDocument, + sal_Bool bExportSelection, sal_Bool bIsExportVectorFormat ); + ~ExportDialog(); +}; + + + +#endif // _EXPORTDIALOG_HXX_ + diff --git a/svtools/source/filter.vcl/filter/exportdialog.src b/svtools/source/filter.vcl/filter/exportdialog.src new file mode 100644 index 000000000000..c9e87989a314 --- /dev/null +++ b/svtools/source/filter.vcl/filter/exportdialog.src @@ -0,0 +1,529 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "exportdialog.hrc" + +String DLG_EXPORT_TITLE +{ + Text [ en-US ] = " Options" ; +}; + +ModalDialog DLG_EXPORT +{ + HelpID = "svtools:ModalDialog:DLG_EXPORT"; + OutputSize = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 178 , 135 ) ; + Moveable = TRUE ; + Closeable = TRUE ; + + FixedLine FL_EXPORT_SIZE + { + Hide = TRUE; + Size = MAP_APPFONT ( 110 , 8 ) ; + Text [ en-US ] = "Size" ; + }; + FixedText FT_SIZEX + { + Hide = TRUE; + Size = MAP_APPFONT ( 41 , 10 ) ; + Text [ en-US ] = "Width:" ; + }; + MetricField MF_SIZEX + { + HelpID = "svtools:MetricField:DLG_EXPORT:MF_SIZEX"; + Hide = TRUE; + Border = TRUE; + Size = MAP_APPFONT ( 30, 12 ) ; + TabStop = TRUE; + Repeat = TRUE; + Spin = FALSE; + StrictFormat = TRUE; + DecimalDigits = 2; + Unit = FUNIT_NONE; + Maximum = 99999; + Last = 255; + }; + ListBox LB_SIZEX + { + HelpID = "svtools:ListBox:DLG_EXPORT:LB_SIZEX"; + Hide = TRUE; + Border = TRUE ; + Size = MAP_APPFONT ( 60, 80 ) ; + DropDown = TRUE ; + Sort = FALSE ; + StringList [ en-US ] = + { + < "inches" ; > ; + < "cm" ; Default ; > ; + < "mm" ; > ; + < "points" ; > ; + < "pixels" ; > ; + }; + }; + FixedText FT_SIZEY + { + Hide = TRUE; + Size = MAP_APPFONT ( 41 , 10 ) ; + Text [ en-US ] = "Height:" ; + }; + MetricField MF_SIZEY + { + HelpID = "svtools:MetricField:DLG_EXPORT:MF_SIZEY"; + Hide = TRUE; + Border = TRUE; + Size = MAP_APPFONT ( 30, 12 ); + TabStop = TRUE; + Repeat = TRUE; + Spin = FALSE; + StrictFormat = TRUE; + DecimalDigits = 2; + Unit = FUNIT_NONE; + Maximum = 99999; + Last = 255 ; + }; + ListBox LB_SIZEY + { + HelpID = "svtools:ListBox:DLG_EXPORT:LB_SIZEY"; + Hide = TRUE; + Border = TRUE ; + Size = MAP_APPFONT ( 60, 80 ) ; + DropDown = TRUE ; + Sort = FALSE ; + StringList [ en-US ] = + { + < "inches" ; > ; + < "cm" ; Default ; > ; + < "mm" ; > ; + < "points" ; > ; + < "pixels" ; > ; + }; + }; + FixedText FT_RESOLUTION + { + Hide = TRUE; + Size = MAP_APPFONT ( 41 , 10 ) ; + Text [ en-US ] = "Resolution:" ; + }; + NumericField NF_RESOLUTION + { + HelpID = "svtools:NumericField:DLG_EXPORT:NF_RESOLUTION"; + Hide = TRUE; + Border = TRUE ; + Size = MAP_APPFONT ( 30, 12 ) ; + TabStop = TRUE ; + Repeat = TRUE ; + Spin = FALSE ; + Maximum = 99999; + Last = 255 ; + }; + ListBox LB_RESOLUTION + { + HelpID = "svtools:ListBox:DLG_EXPORT:LB_RESOLUTION"; + Hide = TRUE; + Border = TRUE ; + Size = MAP_APPFONT ( 60, 80 ) ; + DropDown = TRUE ; + Sort = FALSE ; + StringList [ en-US ] = + { + < "pixels/cm" ; > ; + < "pixels/inch" ; Default ; > ; + < "pixels/meter" ; > ; + }; + }; + FixedLine FL_COLOR_DEPTH + { + Hide = TRUE; + Size = MAP_APPFONT ( 110 , 8 ) ; + Text [ en-US ] = "Color Depth" ; + }; + ListBox LB_COLOR_DEPTH + { + HelpID = "svtools:ListBox:DLG_EXPORT:LB_COLOR_DEPTH"; + Hide = TRUE; + Border = TRUE ; + Size = MAP_APPFONT ( 60, 80 ) ; + DropDown = TRUE ; + Sort = FALSE ; + }; + String STR_1BIT_THRESHOLD + { + Text [ en-US ] = "1 bit threshold"; + }; + String STR_1BIT_DITHERED + { + Text [ en-US ] = "1 bit dithered"; + }; + String STR_4BIT_GRAYSCALE + { + Text [ en-US ] = "4 bit grayscale"; + }; + String STR_4BIT_COLOR_PALETTE + { + Text [ en-US ] = "4 bit color"; + }; + String STR_8BIT_GRAYSCALE + { + Text [ en-US ] = "8 bit grayscale"; + }; + String STR_8BIT_COLOR_PALETTE + { + Text [ en-US ] = "8 bit color"; + }; + String STR_24BIT_TRUE_COLOR + { + Text [ en-US ] = "24 bit true color"; + }; + FixedLine FL_JPG_QUALITY + { + Hide = TRUE; + Size = MAP_APPFONT ( 110 , 8 ) ; + Text [ en-US ] = "Quality" ; + }; + FixedLine FL_COMPRESSION + { + Hide = TRUE; + Size = MAP_APPFONT ( 110 , 8 ) ; + Text [ en-US ] = "Compression" ; + }; + FixedLine FL_MODE + { + Hide = TRUE; + Size = MAP_APPFONT ( 110 , 8 ) ; + Text [ en-US ] = "Mode" ; + }; + FixedLine FL_PBM_OPTIONS + { + Hide = TRUE; + Size = MAP_APPFONT ( 110 , 8 ) ; + Text [ en-US ] = "File Format" ; + }; + ScrollBar SB_COMPRESSION + { + Hide = TRUE; + Size = MAP_APPFONT ( 48, 10 ) ; + VScroll = FALSE ; + HScroll = TRUE; + Drag = TRUE ; + }; + NumericField NF_COMPRESSION + { + HelpID = "svtools:NumericField:DLG_EXPORT:NF_COMPRESSION"; + Hide = TRUE; + Border = TRUE ; + Size = MAP_APPFONT ( 30, 12 ) ; + TabStop = TRUE ; + Repeat = TRUE ; + Spin = FALSE ; + Maximum = 99999; + Last = 255 ; + }; + FixedText FT_JPG_MIN + { + Hide = TRUE; + Size = MAP_APPFONT ( 41 , 10 ) ; + Text [ en-US ] = "1 is minimum Quality and smallest file size." ; + }; + FixedText FT_JPG_MAX + { + Hide = TRUE; + Size = MAP_APPFONT ( 41 , 10 ) ; + Text [ en-US ] = "100 is maximum Quality and biggest file size." ; + }; + FixedText FT_PNG_MIN + { + Hide = TRUE; + Size = MAP_APPFONT ( 41 , 10 ) ; + Text [ en-US ] = "0 is biggest file size and fastest loading." ; + }; + FixedText FT_PNG_MAX + { + Hide = TRUE; + Size = MAP_APPFONT ( 41 , 10 ) ; + Text [ en-US ] = "9 is smallest file size and slowest loading." ; + }; + CheckBox CB_JPG_PREVIEW + { + HelpID = "svtools:CheckBox:DLG_EXPORT:CB_JPG_PREVIEW"; + Hide = TRUE; + Size = MAP_APPFONT ( 60 , 10 ) ; + Text [ en-US ] = "Preview" ; + }; + CheckBox CB_INTERLACED + { + HelpID = "svtools:CheckBox:DLG_EXPORT:CB_INTERLACED"; + Hide = TRUE; + Size = MAP_APPFONT ( 60 , 10 ) ; + Text [ en-US ] = "Interlaced" ; + }; + CheckBox CB_RLE_ENCODING + { + HelpID = "svtools:CheckBox:DLG_EXPORT:CB_RLE_ENCODING"; + Hide = TRUE; + Size = MAP_APPFONT ( 60 , 10 ) ; + Text [ en-US ] = "RLE encoding" ; + }; + FixedLine FL_GIF_DRAWING_OBJECTS + { + Hide = TRUE; + Size = MAP_APPFONT ( 110 , 8 ) ; + Text [ en-US ] = "Drawing Objects" ; + }; + CheckBox CB_SAVE_TRANSPARENCY + { + HelpID = "svtools:CheckBox:DLG_EXPORT:CB_SAVE_TRANSPARENCY"; + Hide = TRUE; + Size = MAP_APPFONT ( 60 , 10 ) ; + Text [ en-US ] = "Save transparency" ; + }; + RadioButton RB_BINARY + { + HelpID = "svtools:RadioButton:DLG_EXPORT:RB_BINARY"; + Hide = TRUE; + Size = MAP_APPFONT ( 105 , 10 ) ; + Text [ en-US ] = "Binary" ; + }; + RadioButton RB_TEXT + { + HelpID = "svtools:RadioButton:DLG_EXPORT:RB_TEXT"; + Hide = TRUE; + Size = MAP_APPFONT ( 105 , 10 ) ; + Text [ en-US ] = "Text" ; + }; + FixedLine FL_EPS_PREVIEW + { + Hide = TRUE; + Size = MAP_APPFONT ( 110 , 8 ) ; + Text [ en-US ] = "Preview" ; + }; + CheckBox CB_EPS_PREVIEW_TIFF + { + HelpID = "svtools:CheckBox:DLG_EXPORT:CB_EPS_PREVIEW_TIFF"; + Hide = TRUE; + Size = MAP_APPFONT ( 60 , 10 ) ; + Text [ en-US ] = "Image Preview (TIFF)" ; + }; + CheckBox CB_EPS_PREVIEW_EPSI + { + HelpID = "svtools:CheckBox:DLG_EXPORT:CB_EPS_PREVIEW_EPSI"; + Hide = TRUE; + Size = MAP_APPFONT ( 60 , 10 ) ; + Text [ en-US ] = "Interchange (EPSI)" ; + }; + FixedLine FL_EPS_VERSION + { + Hide = TRUE; + Size = MAP_APPFONT ( 41 , 10 ) ; + Text [ en-US ] = "Version" ; + }; + RadioButton RB_EPS_LEVEL1 + { + HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_LEVEL1"; + Hide = TRUE; + Size = MAP_APPFONT ( 105 , 10 ) ; + Text [ en-US ] = "Level 1" ; + }; + RadioButton RB_EPS_LEVEL2 + { + HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_LEVEL2"; + Hide = TRUE; + Size = MAP_APPFONT ( 105 , 10 ) ; + Text [ en-US ] = "Level 2" ; + }; + FixedLine FL_EPS_COLOR_FORMAT + { + Hide = TRUE; + Size = MAP_APPFONT ( 41 , 10 ) ; + Text [ en-US ] = "Color format" ; + }; + RadioButton RB_EPS_COLOR_FORMAT1 + { + HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_COLOR_FORMAT1"; + Hide = TRUE; + Size = MAP_APPFONT ( 105 , 10 ) ; + Text [ en-US ] = "Color" ; + }; + RadioButton RB_EPS_COLOR_FORMAT2 + { + HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_COLOR_FORMAT2"; + Hide = TRUE; + Size = MAP_APPFONT ( 105 , 10 ) ; + Text [ en-US ] = "Grayscale" ; + }; + RadioButton RB_EPS_COMPRESSION_LZW + { + HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_COMPRESSION_LZW"; + Hide = TRUE; + Size = MAP_APPFONT ( 105 , 10 ) ; + Text [ en-US ] = "LZW encoding" ; + }; + RadioButton RB_EPS_COMPRESSION_NONE + { + HelpID = "svtools:RadioButton:DLG_EXPORT:RB_EPS_COMPRESSION_NONE"; + Hide = TRUE; + Size = MAP_APPFONT ( 105 , 10 ) ; + Text [ en-US ] = "None" ; + }; + FixedLine FL_ESTIMATED_SIZE + { + Hide = TRUE; + Size = MAP_APPFONT ( 41 , 10 ) ; + }; + FixedText FT_ESTIMATED_SIZE + { + Hide = TRUE; + Size = MAP_APPFONT ( 41 , 10 ) ; + }; + String STR_ESTIMATED_SIZE_PIX_1 + { + Text [ en-US ] = "The picture needs about %1 KB of memory."; + }; + String STR_ESTIMATED_SIZE_PIX_2 + { + Text [ en-US ] = "The picture needs about %1 KB of memory,\n the file size is %2 KB."; + }; + String STR_ESTIMATED_SIZE_VEC + { + Text [ en-US ] = "The file size is %1 KB."; + }; + FixedLine FL_BUTTONS + { + Hide = TRUE; + Size = MAP_APPFONT ( 41 , 10 ) ; + }; + FixedBitmap FB_JPG_PREVIEW + { + Hide = TRUE; + OutputSize = TRUE ; + Scale = TRUE; + Border = TRUE; + }; + ScrollBar SB_ZOOM + { + Hide = TRUE; + Size = MAP_APPFONT ( 48, 10 ); + VScroll = FALSE; + HScroll = TRUE; + Drag = TRUE; + MinPos = 5; + MaxPos = 100; + ThumbPos = 50; + }; + NumericField NF_ZOOM + { + HelpID = "svtools:NumericField:DLG_EXPORT:NF_ZOOM"; + Hide = TRUE; + Border = TRUE ; + Size = MAP_APPFONT ( 30, 12 ) ; + TabStop = TRUE ; + Repeat = TRUE ; + Spin = FALSE ; + Maximum = 3000; + Last = 255 ; + }; + ScrollBar SB_JPG_PREVIEW_HORZ + { + Hide = TRUE; + Size = MAP_APPFONT ( 48, 10 ); + VScroll = FALSE; + HScroll = TRUE; + Drag = TRUE; + MinPos = 0; + MaxPos = 100; + ThumbPos = 50; + }; + ScrollBar SB_JPG_PREVIEW_VERT + { + Hide = TRUE; + Size = MAP_APPFONT ( 48, 10 ); + VScroll = TRUE; + HScroll = FALSE; + Drag = TRUE; + MinPos = 0; + MaxPos = 100; + ThumbPos = 50; + }; + OKButton BTN_OK + { + Hide = TRUE; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + DefButton = TRUE ; + }; + CancelButton BTN_CANCEL + { + Hide = TRUE; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + }; + HelpButton BTN_HELP + { + Hide = TRUE; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + }; +}; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/svtools/source/filter.vcl/filter/filter.cxx b/svtools/source/filter.vcl/filter/filter.cxx index d0066f8a4899..7e0729082841 100644 --- a/svtools/source/filter.vcl/filter/filter.cxx +++ b/svtools/source/filter.vcl/filter/filter.cxx @@ -52,7 +52,7 @@ #include "xbmread.hxx" #include "xpmread.hxx" #include <svl/solar.hrc> -#include "strings.hrc" +#include <svtools/svtools.hrc> #include "sgffilt.hxx" #include "osl/module.hxx" #include <com/sun/star/uno/Reference.h> @@ -79,7 +79,7 @@ #define PMGCHUNG_msOG 0x6d734f47 // Microsoft Office Animated GIF -#if defined WIN || (defined OS2 && !defined ICC) +#if (defined OS2 && !defined ICC) #define IMPORT_FUNCTION_NAME "_GraphicImport" #define EXPORT_FUNCTION_NAME "_GraphicExport" @@ -548,16 +548,48 @@ static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, B if( !bTest || ( rFormatExtension.CompareToAscii( "PCT", 3 ) == COMPARE_EQUAL ) ) { bSomethingTested = TRUE; - BYTE sBuf[4]; + BYTE sBuf[3]; + // store number format + sal_uInt16 oldNumberFormat = rStream.GetNumberFormatInt(); sal_uInt32 nOffset; // in ms documents the pict format is used without the first 512 bytes - for ( nOffset = 10; ( nOffset <= 522 ) && ( ( nStreamPos + nOffset + 3 ) <= nStreamLen ); nOffset += 512 ) + for ( nOffset = 0; ( nOffset <= 512 ) && ( ( nStreamPos + nOffset + 14 ) <= nStreamLen ); nOffset += 512 ) { - rStream.Seek( nStreamPos + nOffset ); + short y1,x1,y2,x2; + bool bdBoxOk = true; + + rStream.Seek( nStreamPos + nOffset); + // size of the pict in version 1 pict ( 2bytes) : ignored + rStream.SeekRel(2); + // bounding box (bytes 2 -> 9) + rStream.SetNumberFormatInt(NUMBERFORMAT_INT_BIGENDIAN); + rStream >> y1 >> x1 >> y2 >> x2; + rStream.SetNumberFormatInt(oldNumberFormat); // reset format + + if (x1 > x2 || y1 > y2 || // bad bdbox + (x1 == x2 && y1 == y2) || // 1 pixel picture + x2-x1 > 2048 || y2-y1 > 2048 ) // picture anormaly big + bdBoxOk = false; + + // read version op rStream.Read( sBuf,3 ); - if ( sBuf[ 0 ] == 0x00 && sBuf[ 1 ] == 0x11 && ( sBuf[ 2 ] == 0x01 || sBuf[ 2 ] == 0x02 ) ) + // see http://developer.apple.com/legacy/mac/library/documentation/mac/pdf/Imaging_With_QuickDraw/Appendix_A.pdf + // normal version 2 - page A23 and A24 + if ( sBuf[ 0 ] == 0x00 && sBuf[ 1 ] == 0x11 && sBuf[ 2 ] == 0x02) { - rFormatExtension = UniString::CreateFromAscii( "PCT", 3 ); - return TRUE; + rFormatExtension = UniString::CreateFromAscii( "PCT", 3 ); + return TRUE; + } + // normal version 1 - page A25 + else if (sBuf[ 0 ] == 0x11 && sBuf[ 1 ] == 0x01 && bdBoxOk) { + rFormatExtension = UniString::CreateFromAscii( "PCT", 3 ); + return TRUE; + } + // previous code kept in order to do not break any compatibility + // probably eroneous + else if ( sBuf[ 0 ] == 0x00 && sBuf[ 1 ] == 0x11 && sBuf[ 2 ] == 0x01 && bdBoxOk) + { + rFormatExtension = UniString::CreateFromAscii( "PCT", 3 ); + return TRUE; } } } @@ -748,7 +780,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r if ( rGraphic.GetType() != GRAPHIC_NONE ) { - sal_Int32 nMode = rConfigItem.ReadInt32( String( ResId( KEY_MODE, *pResMgr ) ), -1 ); + sal_Int32 nMode = rConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "ExportMode" ) ), -1 ); if ( nMode == -1 ) // the property is not there, this is possible, if the graphic filter { // is called via UnoGraphicExporter and not from a graphic export Dialog @@ -778,7 +810,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r Bitmap aBitmap( rGraphic.GetBitmap() ); MapMode aMap( MAP_100TH_INCH ); - sal_Int32 nDPI = rConfigItem.ReadInt32( String( ResId( KEY_RES, *pResMgr ) ), 75 ); + sal_Int32 nDPI = rConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Resolution" ) ), 75 ); Fraction aFrac( 1, Min( Max( nDPI, sal_Int32( 75 ) ), sal_Int32( 600 ) ) ); aMap.SetScaleX( aFrac ); @@ -802,7 +834,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r else aGraphic = rGraphic; - sal_Int32 nColors = rConfigItem.ReadInt32( String( ResId( KEY_COLORS, *pResMgr ) ), 0 ); // #92767# + sal_Int32 nColors = rConfigItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Color" ) ), 0 ); // #92767# if ( nColors ) // graphic conversion necessary ? { BitmapEx aBmpEx( aGraphic.GetBitmapEx() ); @@ -1767,7 +1799,7 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat aBmp = aGraphic.GetBitmap(); } ResMgr* pResMgr = CREATERESMGR( svt ); - sal_Bool bRleCoding = aConfigItem.ReadBool( String( ResId( KEY_RLE_CODING, *pResMgr ) ), sal_True ); + sal_Bool bRleCoding = aConfigItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "RLE_Coding" ) ), sal_True ); // Wollen wir RLE-Kodiert speichern? aBmp.Write( rOStm, bRleCoding ); delete pResMgr; diff --git a/svtools/source/filter.vcl/filter/filter2.cxx b/svtools/source/filter.vcl/filter/filter2.cxx index de2bef64ba6e..d91ec1a19772 100644 --- a/svtools/source/filter.vcl/filter/filter2.cxx +++ b/svtools/source/filter.vcl/filter/filter2.cxx @@ -42,29 +42,6 @@ BYTE* ImplSearchEntry( BYTE* , BYTE* , ULONG , ULONG ); - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -GraphicDescriptor::GraphicDescriptor( const String* pPath ) : - pFileStm ( NULL ) -{ - ImpConstruct(); - - if ( pPath ) - { - INetURLObject aURL( *pPath, INET_PROT_FILE ); - aPathExt = aURL.GetFileExtension().toAsciiLowerCase(); - } - bLinked = TRUE; - bLinkChanged = FALSE; - bWideSearch = FALSE; -} - - /************************************************************************* |* |* @@ -73,19 +50,10 @@ GraphicDescriptor::GraphicDescriptor( const String* pPath ) : GraphicDescriptor::GraphicDescriptor( const INetURLObject& rPath ) : pFileStm( ::utl::UcbStreamHelper::CreateStream( rPath.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ ) ), - aPathExt( rPath.GetFileExtension().toAsciiLowerCase() ) + aPathExt( rPath.GetFileExtension().toAsciiLowerCase() ), + bOwnStream( TRUE ) { - if ( pFileStm ) - { - nStmPos = 0; - pFileStm->Seek( nStmPos ); - bDataReady = TRUE; - } - ImpConstruct(); - - if ( pFileStm && !pFileStm->GetError() ) - bDataReady = TRUE; } /************************************************************************* @@ -95,7 +63,8 @@ GraphicDescriptor::GraphicDescriptor( const INetURLObject& rPath ) : \************************************************************************/ GraphicDescriptor::GraphicDescriptor( SvStream& rInStream, const String* pPath) : - pFileStm ( NULL ) + pFileStm ( &rInStream ), + bOwnStream ( FALSE ) { ImpConstruct(); @@ -104,15 +73,8 @@ GraphicDescriptor::GraphicDescriptor( SvStream& rInStream, const String* pPath) INetURLObject aURL( *pPath ); aPathExt = aURL.GetFileExtension().toAsciiLowerCase(); } - nStmPos = rInStream.Tell(); - pBaseStm = &rInStream; - bBaseStm = TRUE; - - if ( !pBaseStm->GetError() ) - bDataReady = TRUE; } - /************************************************************************* |* |* @@ -121,10 +83,10 @@ GraphicDescriptor::GraphicDescriptor( SvStream& rInStream, const String* pPath) GraphicDescriptor::~GraphicDescriptor() { - delete pFileStm; + if ( bOwnStream ) + delete pFileStm; } - /************************************************************************* |* |* @@ -134,22 +96,9 @@ GraphicDescriptor::~GraphicDescriptor() BOOL GraphicDescriptor::Detect( BOOL bExtendedInfo ) { BOOL bRet = FALSE; - - // Link-Status ueberpruefen - if ( bLinked && bLinkChanged ) - { - DBG_ASSERT( aReqLink.IsSet(), "Wo ist der RequestHandler???" ); - pMemStm = (SvStream*) aReqLink.Call( this ); - if ( pMemStm ) - { - nStmPos = pMemStm->Tell(); - bDataReady = TRUE; - } - } - - if ( bDataReady ) + if ( pFileStm && !pFileStm->GetError() ) { - SvStream& rStm = GetSearchStream(); + SvStream& rStm = *pFileStm; UINT16 nOldFormat = rStm.GetNumberFormatInt(); if ( ImpDetectGIF( rStm, bExtendedInfo ) ) bRet = TRUE; @@ -175,96 +124,13 @@ BOOL GraphicDescriptor::Detect( BOOL bExtendedInfo ) else if ( ImpDetectTGA( rStm, bExtendedInfo ) ) bRet = TRUE; else if ( ImpDetectPSD( rStm, bExtendedInfo ) ) bRet = TRUE; else if ( ImpDetectEPS( rStm, bExtendedInfo ) ) bRet = TRUE; - - // diese Formate lassen sich nur bei WideSearch im gesamten - // Stream ermitteln - else if ( bWideSearch ) - { - if ( ImpDetectPCD( rStm, bExtendedInfo ) ) - bRet = TRUE; - } + else if ( ImpDetectPCD( rStm, bExtendedInfo ) ) bRet = TRUE; rStm.SetNumberFormatInt( nOldFormat ); - rStm.Seek( nStmPos ); } - return bRet; } - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -BOOL GraphicDescriptor::IsDataReady() const -{ - return bDataReady; -} - - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -BOOL GraphicDescriptor::IsWideSearch() const -{ - return bWideSearch; -} - - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -SvStream& GraphicDescriptor::GetSearchStream() const -{ - DBG_ASSERT( bDataReady, "Was laeuft hier falsch???" ); - - if ( bLinked ) - return *pMemStm; - else if ( bBaseStm ) - return *pBaseStm; - else - return *pFileStm; -} - - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -void GraphicDescriptor::SetRequestHdl( const Link& rRequestLink ) -{ - aReqLink = rRequestLink; - bLinkChanged = TRUE; -} - - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -ULONG GraphicDescriptor::GetRequestedByteCount() const -{ - return DATA_SIZE; -} - - -/******************************************************************************/ -/* IMP-Methoden */ -/* */ - - /************************************************************************* |* |* @@ -273,17 +139,10 @@ ULONG GraphicDescriptor::GetRequestedByteCount() const void GraphicDescriptor::ImpConstruct() { - if ( !pFileStm ) - pFileStm = new SvStream(); nFormat = GFF_NOT; nBitsPerPixel = 0; nPlanes = 0; bCompressed = FALSE; - bDataReady = FALSE; - bLinked = FALSE; - bWideSearch = TRUE; - bBaseStm = FALSE; - pMemStm = NULL; } @@ -297,10 +156,9 @@ BOOL GraphicDescriptor::ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo ) { UINT16 nTemp16; BOOL bRet = FALSE; + sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); - rStm.Seek( nStmPos ); - rStm >> nTemp16; // OS/2-BitmapArray @@ -364,7 +222,7 @@ BOOL GraphicDescriptor::ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo ) } } } - + rStm.Seek( nStmPos ); return bRet; } @@ -382,10 +240,10 @@ BOOL GraphicDescriptor::ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo ) BOOL bRet = FALSE; BYTE cByte; + sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); - rStm.Seek( nStmPos ); - rStm >> n32; + if ( n32 == 0x38464947 ) { rStm >> n16; @@ -412,7 +270,7 @@ BOOL GraphicDescriptor::ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo ) } } } - + rStm.Seek( nStmPos ); return bRet; } @@ -423,125 +281,188 @@ BOOL GraphicDescriptor::ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo ) |* \************************************************************************/ +// returns the next jpeg marker, a return value of 0 represents an error +sal_uInt8 ImpDetectJPG_GetNextMarker( SvStream& rStm ) +{ + sal_uInt8 nByte; + do + { + do + { + rStm >> nByte; + if ( rStm.IsEof() || rStm.GetError() ) // as 0 is not allowed as marker, + return 0; // we can use it as errorcode + } + while ( nByte != 0xff ); + do + { + rStm >> nByte; + if ( rStm.IsEof() || rStm.GetError() ) + return 0; + } + while( nByte == 0xff ); + } + while( nByte == 0 ); // 0xff00 represents 0xff and not a marker, + // the marker detection has to be restartet. + return nByte; +} + BOOL GraphicDescriptor::ImpDetectJPG( SvStream& rStm, BOOL bExtendedInfo ) { UINT32 nTemp32; BOOL bRet = FALSE; - BYTE cByte = 0; - BOOL bM_COM; - rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); - rStm.Seek( nStmPos ); + sal_Int32 nStmPos = rStm.Tell(); + rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); rStm >> nTemp32; - // compare upper 28 bits + // compare upper 24 bits if( 0xffd8ff00 == ( nTemp32 & 0xffffff00 ) ) { nFormat = GFF_JPG; - return TRUE; - } - - bM_COM = ( nTemp32 == 0xffd8fffe ); - if ( ( nTemp32 == 0xffd8ffe0 ) || bM_COM ) - { - if( !bM_COM ) - { - rStm.SeekRel( 2 ); - rStm >> nTemp32; - } + bRet = TRUE; - if( bM_COM || ( nTemp32 == 0x4a464946 ) ) + if ( bExtendedInfo ) { - nFormat = GFF_JPG; - bRet = TRUE; + rStm.SeekRel( -2 ); - if( bExtendedInfo ) - { - MapMode aMap; - UINT16 nTemp16; - ULONG nCount = 9; - ULONG nMax; - ULONG nResX; - ULONG nResY; - BYTE cUnit; - - // Groesse des verbleibenden Puffers ermitteln - if ( bLinked ) - nMax = static_cast< SvMemoryStream& >(rStm).GetEndOfData() - - 16; - else - nMax = DATA_SIZE - 16; - - // max. 8K - nMax = Min( nMax, (ULONG) 8192 ); + sal_uInt32 nError( rStm.GetError() ); - // Res-Unit ermitteln - rStm.SeekRel( 3 ); - rStm >> cUnit; - - // ResX ermitteln - rStm >> nTemp16; - nResX = nTemp16; + sal_Bool bScanFailure = sal_False; + sal_Bool bScanFinished = sal_False; - // ResY ermitteln - rStm >> nTemp16; - nResY = nTemp16; - - // SOF0/1-Marker finden, aber dabei - // nicht mehr als DATA_SIZE Pixel lesen, falls - // kein WideSearch - do + while( !bScanFailure && !bScanFinished && !rStm.IsEof() && !rStm.GetError() ) + { + sal_uInt8 nMarker = ImpDetectJPG_GetNextMarker( rStm ); + switch( nMarker ) { - while ( ( cByte != 0xff ) && - ( bWideSearch || ( nCount++ < nMax ) ) ) + // fixed size marker, not having a two byte length parameter + case 0xd0 : // RST0 + case 0xd1 : + case 0xd2 : + case 0xd3 : + case 0xd4 : + case 0xd5 : + case 0xd6 : + case 0xd7 : // RST7 + case 0x01 : // TEM + break; + + case 0xd8 : // SOI (has already been checked, there should not be a second one) + case 0x00 : // marker is invalid, we should stop now + bScanFailure = sal_True; + break; + + case 0xd9 : // EOI + bScanFinished = sal_True; + break; + + // per default we assume marker segments conaining a length parameter + default : { - rStm >> cByte; - } - - while ( ( cByte == 0xff ) && - ( bWideSearch || ( nCount++ < nMax ) ) ) - { - rStm >> cByte; - } - } - while ( ( cByte != 0xc0 ) && - ( cByte != 0xc1 ) && - ( bWideSearch || ( nCount < nMax ) ) ); - - // wir haben den SOF0/1-Marker - if ( ( cByte == 0xc0 ) || ( cByte == 0xc1 ) ) - { - // Hoehe einlesen - rStm.SeekRel( 3 ); - rStm >> nTemp16; - aPixSize.Height() = nTemp16; + sal_uInt16 nLength; + rStm >> nLength; - // Breite einlesen - rStm >> nTemp16; - aPixSize.Width() = nTemp16; - - // Bit/Pixel einlesen - rStm >> cByte; - nBitsPerPixel = ( cByte == 3 ? 24 : cByte == 1 ? 8 : 0 ); + if ( nLength < 2 ) + bScanFailure = sal_True; + else + { + sal_uInt32 nNextMarkerPos = rStm.Tell() + nLength - 2; + switch( nMarker ) + { + case 0xe0 : // APP0 Marker + { + if ( nLength == 16 ) + { + sal_Int32 nIdentifier; + rStm >> nIdentifier; + if ( nIdentifier == 0x4a464946 ) // JFIF Identifier + { + sal_uInt8 nStringTerminator; + sal_uInt8 nMajorRevision; + sal_uInt8 nMinorRevision; + sal_uInt8 nUnits; + sal_uInt16 nHorizontalResolution; + sal_uInt16 nVerticalResolution; + sal_uInt8 nHorzThumbnailPixelCount; + sal_uInt8 nVertThumbnailPixelCount; + + rStm >> nStringTerminator + >> nMajorRevision + >> nMinorRevision + >> nUnits + >> nHorizontalResolution + >> nVerticalResolution + >> nHorzThumbnailPixelCount + >> nVertThumbnailPixelCount; + + // setting the logical size + if ( nUnits && nHorizontalResolution && nVerticalResolution ) + { + MapMode aMap; + aMap.SetMapUnit( nUnits == 1 ? MAP_INCH : MAP_CM ); + aMap.SetScaleX( Fraction( 1, nHorizontalResolution ) ); + aMap.SetScaleY( Fraction( 1, nVerticalResolution ) ); + aLogSize = OutputDevice::LogicToLogic( aPixSize, aMap, MapMode( MAP_100TH_MM ) ); + } + } + } + } + break; - // logische Groesse setzen - if ( cUnit && nResX && nResY ) - { - aMap.SetMapUnit( cUnit == 1 ? MAP_INCH : MAP_CM ); - aMap.SetScaleX( Fraction( 1, nResX ) ); - aMap.SetScaleY( Fraction( 1, nResY ) ); - aLogSize = OutputDevice::LogicToLogic( aPixSize, aMap, - MapMode( MAP_100TH_MM ) ); + // Start of Frame Markers + case 0xc0 : // SOF0 + case 0xc1 : // SOF1 + case 0xc2 : // SOF2 + case 0xc3 : // SOF3 + case 0xc5 : // SOF5 + case 0xc6 : // SOF6 + case 0xc7 : // SOF7 + case 0xc9 : // SOF9 + case 0xca : // SOF10 + case 0xcb : // SOF11 + case 0xcd : // SOF13 + case 0xce : // SOF14 + case 0xcf : // SOF15 + { + sal_uInt8 nSamplePrecision; + sal_uInt16 nNumberOfLines; + sal_uInt16 nSamplesPerLine; + sal_uInt8 nNumberOfImageComponents; + sal_uInt8 nComponentsIdentifier; + sal_uInt8 nHorizontalSamplingFactor; + sal_uInt8 nVerticalSamplingFactor; + sal_uInt8 nQuantizationTableDestinationSelector; + rStm >> nSamplePrecision + >> nNumberOfLines + >> nSamplesPerLine + >> nNumberOfImageComponents + >> nComponentsIdentifier + >> nHorizontalSamplingFactor + >> nQuantizationTableDestinationSelector; + nVerticalSamplingFactor = nHorizontalSamplingFactor & 0xf; + nHorizontalSamplingFactor >>= 4; + + aPixSize.Height() = nNumberOfLines; + aPixSize.Width() = nSamplesPerLine; + nBitsPerPixel = ( nNumberOfImageComponents == 3 ? 24 : nNumberOfImageComponents == 1 ? 8 : 0 ); + nPlanes = 1; + + bScanFinished = sal_True; + } + break; + } + rStm.Seek( nNextMarkerPos ); + } } - - // Planes immer 1 - nPlanes = 1; + break; } } + rStm.SetError( nError ); } } - + rStm.Seek( nStmPos ); return bRet; } @@ -556,37 +477,26 @@ BOOL GraphicDescriptor::ImpDetectPCD( SvStream& rStm, BOOL ) { BOOL bRet = FALSE; + sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); - rStm.Seek( nStmPos ); - if ( bWideSearch ) - { - UINT32 nTemp32; - UINT16 nTemp16; - BYTE cByte; + UINT32 nTemp32; + UINT16 nTemp16; + BYTE cByte; - rStm.SeekRel( 2048 ); - rStm >> nTemp32; - rStm >> nTemp16; - rStm >> cByte; + rStm.SeekRel( 2048 ); + rStm >> nTemp32; + rStm >> nTemp16; + rStm >> cByte; - if ( ( nTemp32 == 0x5f444350 ) && - ( nTemp16 == 0x5049 ) && - ( cByte == 0x49 ) ) - { - nFormat = GFF_PCD; - bRet = TRUE; - } - } - else + if ( ( nTemp32 == 0x5f444350 ) && + ( nTemp16 == 0x5049 ) && + ( cByte == 0x49 ) ) { - bRet = aPathExt.CompareToAscii( "pcd", 3 ) == COMPARE_EQUAL; - if ( bRet ) - { - nFormat = GFF_PCD; - } + nFormat = GFF_PCD; + bRet = TRUE; } - + rStm.Seek( nStmPos ); return bRet; } @@ -608,10 +518,10 @@ BOOL GraphicDescriptor::ImpDetectPCX( SvStream& rStm, BOOL bExtendedInfo ) BOOL bRet = FALSE; BYTE cByte; + sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); - rStm.Seek( nStmPos ); - rStm >> cByte; + if ( cByte == 0x0a ) { nFormat = GFF_PCX; @@ -675,6 +585,7 @@ BOOL GraphicDescriptor::ImpDetectPCX( SvStream& rStm, BOOL bExtendedInfo ) } } + rStm.Seek( nStmPos ); return bRet; } @@ -690,10 +601,10 @@ BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo ) UINT32 nTemp32; BOOL bRet = FALSE; + sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); - rStm.Seek( nStmPos ); - rStm >> nTemp32; + if ( nTemp32 == 0x89504e47 ) { rStm >> nTemp32; @@ -726,55 +637,52 @@ BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo ) nPlanes = 1; bCompressed = TRUE; - if ( bWideSearch ) - { - UINT32 nLen32; + UINT32 nLen32; - rStm.SeekRel( 8 ); + rStm.SeekRel( 8 ); - // so lange ueberlesen, bis wir den pHYs-Chunk haben oder - // den Anfang der Bilddaten + // so lange ueberlesen, bis wir den pHYs-Chunk haben oder + // den Anfang der Bilddaten + rStm >> nLen32; + rStm >> nTemp32; + while( ( nTemp32 != 0x70485973 ) && ( nTemp32 != 0x49444154 ) ) + { + rStm.SeekRel( 4 + nLen32 ); rStm >> nLen32; rStm >> nTemp32; - while( ( nTemp32 != 0x70485973 ) && ( nTemp32 != 0x49444154 ) ) - { - rStm.SeekRel( 4 + nLen32 ); - rStm >> nLen32; - rStm >> nTemp32; - } + } - if ( nTemp32 == 0x70485973 ) - { - ULONG nXRes; - ULONG nYRes; + if ( nTemp32 == 0x70485973 ) + { + ULONG nXRes; + ULONG nYRes; - // horizontale Aufloesung - rStm >> nTemp32; - nXRes = nTemp32; + // horizontale Aufloesung + rStm >> nTemp32; + nXRes = nTemp32; - // vertikale Aufloesung - rStm >> nTemp32; - nYRes = nTemp32; + // vertikale Aufloesung + rStm >> nTemp32; + nYRes = nTemp32; - // Unit einlesen - rStm >> cByte; + // Unit einlesen + rStm >> cByte; - if ( cByte ) - { - if ( nXRes ) - aLogSize.Width() = ( aPixSize.Width() * 100000 ) / - nTemp32; + if ( cByte ) + { + if ( nXRes ) + aLogSize.Width() = ( aPixSize.Width() * 100000 ) / + nTemp32; - if ( nYRes ) - aLogSize.Height() = ( aPixSize.Height() * 100000 ) / - nTemp32; - } + if ( nYRes ) + aLogSize.Height() = ( aPixSize.Height() * 100000 ) / + nTemp32; } } } } } - + rStm.Seek( nStmPos ); return bRet; } @@ -792,7 +700,7 @@ BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo ) BYTE cByte1; BYTE cByte2; - rStm.Seek( nStmPos ); + sal_Int32 nStmPos = rStm.Tell(); rStm >> cByte1; rStm >> cByte2; if ( cByte1 == cByte2 ) @@ -829,14 +737,14 @@ BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo ) rStm >> nTemp32; rStm.SeekRel( ( nCount = ( nTemp32 + 2 ) ) - 0x08 ); - if ( bWideSearch || ( nCount < nMax ) ) + if ( nCount < nMax ) { // Tag's lesen, bis wir auf Tag256 ( Width ) treffen // nicht mehr Bytes als DATA_SIZE lesen rStm >> nTemp16; while ( nTemp16 != 256 ) { - bOk = bWideSearch || ( nCount < nMax ); + bOk = nCount < nMax; if ( !bOk ) { break; @@ -912,7 +820,7 @@ BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo ) } } } - + rStm.Seek( nStmPos ); return bRet; } @@ -965,11 +873,12 @@ BOOL GraphicDescriptor::ImpDetectPBM( SvStream& rStm, BOOL ) bRet = TRUE; else { + sal_Int32 nStmPos = rStm.Tell(); BYTE nFirst, nSecond; - rStm.Seek( nStmPos ); rStm >> nFirst >> nSecond; if ( nFirst == 'P' && ( ( nSecond == '1' ) || ( nSecond == '4' ) ) ) bRet = TRUE; + rStm.Seek( nStmPos ); } if ( bRet ) @@ -992,11 +901,12 @@ BOOL GraphicDescriptor::ImpDetectPGM( SvStream& rStm, BOOL ) bRet = TRUE; else { - BYTE nFirst, nSecond; - rStm.Seek( nStmPos ); + BYTE nFirst, nSecond; + sal_Int32 nStmPos = rStm.Tell(); rStm >> nFirst >> nSecond; if ( nFirst == 'P' && ( ( nSecond == '2' ) || ( nSecond == '5' ) ) ) bRet = TRUE; + rStm.Seek( nStmPos ); } if ( bRet ) @@ -1020,10 +930,11 @@ BOOL GraphicDescriptor::ImpDetectPPM( SvStream& rStm, BOOL ) else { BYTE nFirst, nSecond; - rStm.Seek( nStmPos ); + sal_Int32 nStmPos = rStm.Tell(); rStm >> nFirst >> nSecond; if ( nFirst == 'P' && ( ( nSecond == '3' ) || ( nSecond == '6' ) ) ) bRet = TRUE; + rStm.Seek( nStmPos ); } if ( bRet ) @@ -1041,16 +952,17 @@ BOOL GraphicDescriptor::ImpDetectPPM( SvStream& rStm, BOOL ) BOOL GraphicDescriptor::ImpDetectRAS( SvStream& rStm, BOOL ) { UINT32 nMagicNumber; - rStm.Seek( nStmPos ); + BOOL bRet = FALSE; + sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); rStm >> nMagicNumber; if ( nMagicNumber == 0x59a66a95 ) { nFormat = GFF_RAS; - return TRUE; + bRet = TRUE; } - else - return FALSE; + rStm.Seek( nStmPos ); + return bRet; } /************************************************************************* @@ -1079,7 +991,7 @@ BOOL GraphicDescriptor::ImpDetectPSD( SvStream& rStm, BOOL bExtendedInfo ) BOOL bRet = FALSE; UINT32 nMagicNumber; - rStm.Seek( nStmPos ); + sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); rStm >> nMagicNumber; if ( nMagicNumber == 0x38425053 ) @@ -1123,6 +1035,7 @@ BOOL GraphicDescriptor::ImpDetectPSD( SvStream& rStm, BOOL bExtendedInfo ) if ( bRet ) nFormat = GFF_PSD; + rStm.Seek( nStmPos ); return bRet; } @@ -1139,8 +1052,9 @@ BOOL GraphicDescriptor::ImpDetectEPS( SvStream& rStm, BOOL ) sal_uInt32 nFirstLong; sal_uInt8 nFirstBytes[20]; + BOOL bRet = FALSE; - rStm.Seek( nStmPos ); + sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); rStm >> nFirstLong; rStm.SeekRel( -4 ); @@ -1151,10 +1065,10 @@ BOOL GraphicDescriptor::ImpDetectEPS( SvStream& rStm, BOOL ) && ImplSearchEntry( &nFirstBytes[15], (sal_uInt8*)"EPS", 3, 3 ) ) ) { nFormat = GFF_EPS; - return TRUE; + bRet = TRUE; } - else - return FALSE; + rStm.Seek( nStmPos ); + return bRet; } /************************************************************************* @@ -1201,9 +1115,11 @@ BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL ) nFormat = GFF_PCT; else { + sal_Int32 nStmPos = rStm.Tell(); + BYTE sBuf[4]; - rStm.Seek( nStmPos + 522 ); + rStm.SeekRel( 522 ); rStm.Read( sBuf, 3 ); if( !rStm.GetError() ) @@ -1215,6 +1131,7 @@ BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL ) nFormat = GFF_PCT; } } + rStm.Seek( nStmPos ); } return bRet; @@ -1230,18 +1147,20 @@ BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL ) BOOL GraphicDescriptor::ImpDetectSGF( SvStream& rStm, BOOL ) { BOOL bRet = FALSE; - if( aPathExt.CompareToAscii( "sgf", 3 ) == COMPARE_EQUAL ) bRet = TRUE; else { + sal_Int32 nStmPos = rStm.Tell(); + BYTE nFirst, nSecond; - rStm.Seek( nStmPos ); rStm >> nFirst >> nSecond; if( nFirst == 'J' && nSecond == 'J' ) bRet = TRUE; + + rStm.Seek( nStmPos ); } if( bRet ) @@ -1279,9 +1198,8 @@ BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo ) BOOL bRet = FALSE; BYTE cByte; + sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); - rStm.Seek( nStmPos ); - rStm >> n32; if ( n32 == 0x44475653 ) { @@ -1342,7 +1260,7 @@ BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo ) } } } - + rStm.Seek( nStmPos ); return bRet; } @@ -1417,3 +1335,5 @@ String GraphicDescriptor::GetImportFormatShortName( sal_uInt16 nFormat ) return String( aKeyName, RTL_TEXTENCODING_ASCII_US ); } + + diff --git a/svtools/source/filter.vcl/filter/fldll.cxx b/svtools/source/filter.vcl/filter/fldll.cxx deleted file mode 100644 index b44e08835f34..000000000000 --- a/svtools/source/filter.vcl/filter/fldll.cxx +++ /dev/null @@ -1,76 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svtools.hxx" - -#ifdef WIN -#include <svwin.h> - -// Statische DLL-Verwaltungs-Variablen -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - - -/*************************************************************************** -|* -|* LibMain() -|* -|* Beschreibung Initialisierungsfunktion der DLL -|* Ersterstellung TH 05.05.93 -|* Letzte Aenderung TH 05.05.93 -|* -***************************************************************************/ - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -/*************************************************************************** -|* -|* WEP() -|* -|* Beschreibung DLL-Deinitialisierung -|* Ersterstellung TH 05.05.93 -|* Letzte Aenderung TH 05.05.93 -|* -***************************************************************************/ - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif - diff --git a/svtools/source/filter.vcl/filter/makefile.mk b/svtools/source/filter.vcl/filter/makefile.mk index 272bb9a76b03..11d35150bda8 100644 --- a/svtools/source/filter.vcl/filter/makefile.mk +++ b/svtools/source/filter.vcl/filter/makefile.mk @@ -41,16 +41,11 @@ SOLARINC+=-I../../inc # --- Files -------------------------------------------------------- SRS1NAME=$(TARGET) -SRC1FILES= strings.src \ - dlgexpor.src \ - dlgepng.src \ - dlgejpg.src +SRC1FILES=exportdialog.src SLOFILES= $(SLO)$/filter.obj \ $(SLO)$/filter2.obj \ - $(SLO)$/dlgexpor.obj \ - $(SLO)$/dlgejpg.obj \ - $(SLO)$/dlgepng.obj \ + $(SLO)$/exportdialog.obj \ $(SLO)$/sgfbram.obj \ $(SLO)$/sgvmain.obj \ $(SLO)$/sgvtext.obj \ @@ -59,28 +54,26 @@ SLOFILES= $(SLO)$/filter.obj \ $(SLO)$/FilterConfigCache.obj \ $(SLO)$/SvFilterOptionsDialog.obj +EXCEPTIONSFILES= $(SLO)$/exportdialog.obj + EXCEPTIONSNOOPTFILES= $(SLO)$/filter.obj \ $(SLO)$/FilterConfigItem.obj \ $(SLO)$/FilterConfigCache.obj \ $(SLO)$/SvFilterOptionsDialog.obj LIB1TARGET= $(SLB)$/$(TARGET).uno.lib -LIB1OBJFILES= \ - $(SLO)$/dlgexpor.obj \ - $(SLO)$/dlgejpg.obj \ - $(SLO)$/dlgepng.obj \ - $(SLO)$/SvFilterOptionsDialog.obj +LIB1OBJFILES= $(SLO)$/exportdialog.obj \ + $(SLO)$/SvFilterOptionsDialog.obj LIB2TARGET= $(SLB)$/$(TARGET).lib -LIB2OBJFILES= \ - $(SLO)$/filter.obj \ - $(SLO)$/filter2.obj \ - $(SLO)$/sgfbram.obj \ - $(SLO)$/sgvmain.obj \ - $(SLO)$/sgvtext.obj \ - $(SLO)$/sgvspln.obj \ - $(SLO)$/FilterConfigItem.obj \ - $(SLO)$/FilterConfigCache.obj +LIB2OBJFILES= $(SLO)$/filter.obj \ + $(SLO)$/filter2.obj \ + $(SLO)$/sgfbram.obj \ + $(SLO)$/sgvmain.obj \ + $(SLO)$/sgvtext.obj \ + $(SLO)$/sgvspln.obj \ + $(SLO)$/FilterConfigItem.obj \ + $(SLO)$/FilterConfigCache.obj # --- Targets ------------------------------------------------------- diff --git a/svtools/source/filter.vcl/filter/sgfbram.cxx b/svtools/source/filter.vcl/filter/sgfbram.cxx index 43cf0fbbacd3..3d1a71f5a2db 100644 --- a/svtools/source/filter.vcl/filter/sgfbram.cxx +++ b/svtools/source/filter.vcl/filter/sgfbram.cxx @@ -37,10 +37,6 @@ #include "sgffilt.hxx" #include "sgfbram.hxx" -#if defined( WIN ) && defined( MSC ) -#pragma code_seg( "SVTOOLS_FILTER4", "SVTOOLS_CODE" ) -#endif - /************************************************************************* |* |* operator>>( SvStream&, SgfHeader& ) diff --git a/svtools/source/filter.vcl/filter/sgvmain.cxx b/svtools/source/filter.vcl/filter/sgvmain.cxx index e175380244b3..293c6dab7964 100644 --- a/svtools/source/filter.vcl/filter/sgvmain.cxx +++ b/svtools/source/filter.vcl/filter/sgvmain.cxx @@ -110,20 +110,11 @@ // //////////////////////////////////////////////////////////////////////////////////////////////////// -#if defined( WIN ) && defined( MSC ) -#pragma code_seg( "svtools", "AUTO_CODE" ) -#endif - //////////////////////////////////////////////////////////////////////////////////////////////////// // Fuer Fontuebersetzung /////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// SgfFontLst* pSgfFonts = 0; -#if defined( WIN ) && defined( MSC ) -#pragma code_seg( "SVTOOLS_FILTER3", "SVTOOLS_CODE" ) -static void AntiMscBug() {} -#endif - //////////////////////////////////////////////////////////////////////////////////////////////////// // Fuer Kreisunterarten, Text und gedrehte Rechtecke /////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -1137,7 +1128,3 @@ for n:=0 to 63 do end; */ -#if defined( WIN ) && defined( MSC ) -#pragma code_seg( "svtools", "AUTO_CODE" ) -#endif - diff --git a/svtools/source/filter.vcl/filter/sgvspln.cxx b/svtools/source/filter.vcl/filter/sgvspln.cxx index 7a23e85f4dbe..d695e171a194 100644 --- a/svtools/source/filter.vcl/filter/sgvspln.cxx +++ b/svtools/source/filter.vcl/filter/sgvspln.cxx @@ -33,11 +33,6 @@ #include <tools/poly.hxx> -#if defined( WIN ) && defined( MSC ) -#pragma code_seg( "SVTOOLS_FILTER2", "SVTOOLS_CODE" ) -#pragma optimize( "", off ) -#endif - #if defined( PM2 ) && defined( __BORLANDC__ ) #pragma option -Od #endif diff --git a/svtools/source/filter.vcl/filter/sgvtext.cxx b/svtools/source/filter.vcl/filter/sgvtext.cxx index 4a0be80b55be..9a82cd486599 100644 --- a/svtools/source/filter.vcl/filter/sgvtext.cxx +++ b/svtools/source/filter.vcl/filter/sgvtext.cxx @@ -38,10 +38,6 @@ extern SgfFontLst* pSgfFonts; -#if defined( WIN ) && defined( MSC ) -#pragma code_seg( "SVTOOLS_FILTER1", "SVTOOLS_CODE" ) -#endif - #ifndef abs #define abs(x) ((x)<0 ? -(x) : (x)) #endif @@ -621,7 +617,7 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr switch (Atr.GetFont()) { case 92500: case 92501: case 92504: case 92505: { -#if defined(WIN) || defined(WNT) || defined(PM2) +#if defined(WNT) || defined(PM2) FNam=String::CreateFromAscii( "Times New Roman" ); // CG Times ist unter Windows und OS/2 Times New Roman #else FNam=String::CreateFromAscii( "Times" ); // ansonsten ist das einfach Times @@ -630,7 +626,7 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr aFont.SetFamily(FAMILY_ROMAN); } break; case 94021: case 94022: case 94023: case 94024: { -#if defined(WIN) || defined(WNT) +#if defined(WNT) FNam=String::CreateFromAscii( "Arial", 5 ); // Univers ist unter Windows Arial #else FNam=String::CreateFromAscii( "Helvetica" ); // und ansonsten Helvetica @@ -639,7 +635,7 @@ USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dr StdBrei=47; } break; case 93950: case 93951: case 93952: case 93953: { -#if defined(WIN) || defined(WNT) +#if defined(WNT) FNam=String::CreateFromAscii( "Courier New" ); // Der Vector-Courierfont unter Windows heisst Courier New #else FNam=String::CreateFromAscii( "Courier" ); // ansonsten ist und bleibt Courier immer Courier diff --git a/svtools/source/filter.vcl/filter/strings.hrc b/svtools/source/filter.vcl/filter/strings.hrc deleted file mode 100644 index 0eea67fb2338..000000000000 --- a/svtools/source/filter.vcl/filter/strings.hrc +++ /dev/null @@ -1,27 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include <svtools/svtools.hrc> diff --git a/svtools/source/filter.vcl/filter/strings.src b/svtools/source/filter.vcl/filter/strings.src deleted file mode 100644 index 60e628ee0b5c..000000000000 --- a/svtools/source/filter.vcl/filter/strings.src +++ /dev/null @@ -1,85 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "strings.hrc" - -String EXPORT_DIALOG_TITLE -{ - Text [ en-US ] = " Options" ; -}; - -String KEY_MODE -{ - Text = "ExportMode" ; -}; - -String KEY_RES -{ - Text = "Resolution" ; -}; - -String KEY_SIZE -{ - Text = "Size" ; -}; - -String KEY_COLORS -{ - Text = "Color" ; -}; - -String KEY_RLE_CODING -{ - Text = "RLE_Coding" ; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/svtools/source/filter.vcl/jpeg/jpeg.h b/svtools/source/filter.vcl/jpeg/jpeg.h index deb06600474c..82a2f80a838c 100644 --- a/svtools/source/filter.vcl/jpeg/jpeg.h +++ b/svtools/source/filter.vcl/jpeg/jpeg.h @@ -51,11 +51,7 @@ struct JPEGCreateBitmapParam typedef struct my_error_mgr* my_error_ptr; typedef unsigned char BYTE; -#ifdef WIN -typedef unsigned char _huge* HPBYTE; -#else typedef unsigned char* HPBYTE; -#endif void* JPEGMalloc( size_t size ); void JPEGFree( void *ptr ); diff --git a/svtools/source/filter.vcl/wmf/winmtf.cxx b/svtools/source/filter.vcl/wmf/winmtf.cxx index bf176015fd77..787e6522b890 100644 --- a/svtools/source/filter.vcl/wmf/winmtf.cxx +++ b/svtools/source/filter.vcl/wmf/winmtf.cxx @@ -2043,7 +2043,7 @@ void WinMtfOutput::ModifyWorldTransform( const XForm& rXForm, UINT32 nMode ) case MWT_IDENTITY : { maXForm.eM11 = maXForm.eM12 = maXForm.eM21 = maXForm.eM22 = 1.0f; - maXForm.eDx = maXForm.eDx = 0.0f; + maXForm.eDx = maXForm.eDy = 0.0f; } break; diff --git a/svtools/source/filter.vcl/wmf/winwmf.cxx b/svtools/source/filter.vcl/wmf/winwmf.cxx index f7c4f51ce1e2..cea1ab490b04 100644 --- a/svtools/source/filter.vcl/wmf/winwmf.cxx +++ b/svtools/source/filter.vcl/wmf/winwmf.cxx @@ -1081,6 +1081,8 @@ void WMFReader::ReadWMF() nEMFRec = 0; nEMFSize = 0; + sal_Bool bEMFAvailable = sal_False; + pOut->SetMapMode( MM_ANISOTROPIC ); pOut->SetWinOrg( Point() ); pOut->SetWinExt( Size( 1, 1 ) ); @@ -1117,50 +1119,53 @@ void WMFReader::ReadWMF() break; } - if( aBmpSaveList.Count() && - ( nFunction != W_META_STRETCHDIB ) && - ( nFunction != W_META_DIBBITBLT ) && - ( nFunction != W_META_DIBSTRETCHBLT ) ) - { - pOut->ResolveBitmapActions( aBmpSaveList ); - } - if ( !nSkipActions ) - ReadRecordParams( nFunction ); - else - nSkipActions--; - - if( pEMFStream && nEMFRecCount == nEMFRec ) + if ( !bEMFAvailable ) { - GDIMetaFile aMeta; - pEMFStream->Seek( 0 ); - EnhWMFReader* pEMFReader = new EnhWMFReader ( *pEMFStream, aMeta ); - BOOL bRead = pEMFReader->ReadEnhWMF(); - delete pEMFReader; // destroy first!!! - - if( bRead ) + if( aBmpSaveList.Count() && + ( nFunction != W_META_STRETCHDIB ) && + ( nFunction != W_META_DIBBITBLT ) && + ( nFunction != W_META_DIBSTRETCHBLT ) ) { - pOut->AddFromGDIMetaFile( aMeta ); - pOut->SetrclFrame( Rectangle(0, 0, aMeta.GetPrefSize().Width(), aMeta.GetPrefSize().Height() )); - // we have successfully read the embedded EMF data - // no need to process WMF data further - break; + pOut->ResolveBitmapActions( aBmpSaveList ); } + if ( !nSkipActions ) + ReadRecordParams( nFunction ); else + nSkipActions--; + + if( pEMFStream && nEMFRecCount == nEMFRec ) { - // something went wrong - // continue with WMF, don't try this again - delete pEMFStream; - pEMFStream = NULL; - } + GDIMetaFile aMeta; + pEMFStream->Seek( 0 ); + EnhWMFReader* pEMFReader = new EnhWMFReader ( *pEMFStream, aMeta ); + bEMFAvailable = pEMFReader->ReadEnhWMF(); + delete pEMFReader; // destroy first!!! + if( bEMFAvailable ) + { + pOut->AddFromGDIMetaFile( aMeta ); + pOut->SetrclFrame( Rectangle(0, 0, aMeta.GetPrefSize().Width(), aMeta.GetPrefSize().Height() )); + + // the stream needs to be set to the wmf end position, + // otherwise the GfxLink that is created will be incorrect + // (leading to graphic loss after swapout/swapin). + // so we will proceed normally, but are ignoring further wmf + // records + } + else + { + // something went wrong + // continue with WMF, don't try this again + delete pEMFStream; + pEMFStream = NULL; + } + } } - nPos += nRecSize * 2; if ( nPos <= nEndPos ) pWMF->Seek( nPos ); else pWMF->SetError( SVSTREAM_FILEFORMAT_ERROR ); - } } else diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx index fbf95406a63a..f1674dcd7d4a 100644 --- a/svtools/source/graphic/provider.cxx +++ b/svtools/source/graphic/provider.cxx @@ -231,19 +231,19 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadStandardImage( co if( ( 0 == rResourceURL.getToken( 0, '/', nIndex ).compareToAscii( "private:standardimage" ) ) ) { rtl::OUString sImageName( rResourceURL.copy( nIndex ) ); - if ( sImageName.compareToAscii( "info" ) ) + if ( sImageName.equalsAscii( "info" ) ) { xRet = InfoBox::GetStandardImage().GetXGraphic(); } - else if ( sImageName.compareToAscii( "warning" ) ) + else if ( sImageName.equalsAscii( "warning" ) ) { xRet = WarningBox::GetStandardImage().GetXGraphic(); } - else if ( sImageName.compareToAscii( "error" ) ) + else if ( sImageName.equalsAscii( "error" ) ) { xRet = ErrorBox::GetStandardImage().GetXGraphic(); } - else if ( sImageName.compareToAscii( "query" ) ) + else if ( sImageName.equalsAscii( "query" ) ) { xRet = QueryBox::GetStandardImage().GetXGraphic(); } diff --git a/svtools/source/hatchwindow/hatchwindowfactory.component b/svtools/source/hatchwindow/hatchwindowfactory.component new file mode 100644 index 000000000000..153fc8796281 --- /dev/null +++ b/svtools/source/hatchwindow/hatchwindowfactory.component @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.embed.DocumentCloser"> + <service name="com.sun.star.embed.DocumentCloser"/> + </implementation> + <implementation name="com.sun.star.comp.embed.HatchWindowFactory"> + <service name="com.sun.star.comp.embed.HatchWindowFactory"/> + <service name="com.sun.star.embed.HatchWindowFactory"/> + </implementation> +</component> diff --git a/svtools/source/hatchwindow/hatchwindowfactory.cxx b/svtools/source/hatchwindow/hatchwindowfactory.cxx index f8dbddff3761..0eec027167c2 100644 --- a/svtools/source/hatchwindow/hatchwindowfactory.cxx +++ b/svtools/source/hatchwindow/hatchwindowfactory.cxx @@ -112,45 +112,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment ( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo ( - void * /* pServiceManager */, void * pRegistryKey) -{ - if (pRegistryKey) - { - uno::Reference< registry::XRegistryKey> xRegistryKey ( - reinterpret_cast< registry::XRegistryKey* >(pRegistryKey)); - uno::Reference< registry::XRegistryKey> xNewKey; - - // OHatchWindowFactory registration - - xNewKey = xRegistryKey->createKey ( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + - OHatchWindowFactory::impl_staticGetImplementationName() + - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) ); - - uno::Sequence< ::rtl::OUString > aServices = - OHatchWindowFactory::impl_staticGetSupportedServiceNames(); - for (sal_Int32 i = 0, n = aServices.getLength(); i < n; i++ ) - xNewKey->createKey( aServices.getConstArray()[i] ); - - - // ODocumentCloser registration - - xNewKey = xRegistryKey->createKey ( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + - ODocumentCloser::impl_staticGetImplementationName() + - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) ); - - aServices = ODocumentCloser::impl_staticGetSupportedServiceNames(); - for (sal_Int32 i = 0, n = aServices.getLength(); i < n; i++ ) - xNewKey->createKey( aServices.getConstArray()[i] ); - - - return sal_True; - } - return sal_False; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */) { diff --git a/svtools/source/hatchwindow/makefile.mk b/svtools/source/hatchwindow/makefile.mk index 316e4ab1bfe2..3c736bc4e66a 100644 --- a/svtools/source/hatchwindow/makefile.mk +++ b/svtools/source/hatchwindow/makefile.mk @@ -63,3 +63,11 @@ DEF1NAME= $(SHL1TARGET) .INCLUDE : target.mk + +ALLTAR : $(MISC)/hatchwindowfactory.component + +$(MISC)/hatchwindowfactory.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt hatchwindowfactory.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt hatchwindowfactory.component diff --git a/svtools/source/inc/unoiface.hxx b/svtools/source/inc/unoiface.hxx index 5d34ea6f47ed..f15cb7c10d4c 100644 --- a/svtools/source/inc/unoiface.hxx +++ b/svtools/source/inc/unoiface.hxx @@ -39,7 +39,6 @@ #include <com/sun/star/awt/XTextLayoutConstrains.hpp> #include <svtools/svmedit.hxx> #include <svtools/fmtfield.hxx> -#include <com/sun/star/awt/XImageConsumer.hpp> #include <comphelper/uno3.hxx> @@ -243,7 +242,7 @@ struct RMItemData ::rtl::OUString Label; }; -typedef ::cppu::ImplInheritanceHelper3 < VCLXImageConsumer +typedef ::cppu::ImplInheritanceHelper3 < VCLXGraphicControl , ::com::sun::star::container::XContainerListener , ::com::sun::star::beans::XPropertyChangeListener , ::com::sun::star::awt::XItemEventBroadcaster @@ -288,7 +287,7 @@ public: protected: - // VCLXImageConsumer overridables + // VCLXGraphicControl overridables virtual void ImplSetNewImage(); static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); diff --git a/svtools/source/java/javainteractionhandler.cxx b/svtools/source/java/javainteractionhandler.cxx index ec34ed07f25d..a7420dbc388f 100644 --- a/svtools/source/java/javainteractionhandler.cxx +++ b/svtools/source/java/javainteractionhandler.cxx @@ -147,28 +147,10 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque // No suitable JRE found vos::OGuard aSolarGuard( Application::GetSolarMutex() ); m_bJavaNotFound_Handled = true; - //We first try to get the patch resource svp680xxx.res - //If the resource is not found then svt680xxx.res is used - ResId idWBX = SvtResId(WARNINGBOX_JAVANOTFOUND); - SvpResId pidPatchWBX(WARNINGBOX_JAVANOTFOUND); - pidPatchWBX.SetRT(RSC_WARNINGBOX); - ResMgr *pMgrWB = pidPatchWBX.GetResMgr(); - if (pMgrWB && pMgrWB->IsAvailable(pidPatchWBX)) - idWBX = pidPatchWBX; - WarningBox aWarningBox( NULL, idWBX); - - String aTitle; - SvpResId pidString(STR_WARNING_JAVANOTFOUND); - pidString.SetRT(RSC_STRING); - ResMgr *pmgr = pidString.GetResMgr(); - if ( pmgr && pmgr->IsAvailable(pidString)) - aTitle = String(pidString); - else - aTitle = String( SvtResId( STR_WARNING_JAVANOTFOUND )); - + WarningBox aWarningBox( NULL, SvtResId( WARNINGBOX_JAVANOTFOUND ) ); + String aTitle( SvtResId( STR_WARNING_JAVANOTFOUND ) ); aWarningBox.SetText( aTitle ); nResult = aWarningBox.Execute(); - } else { @@ -182,25 +164,8 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque // javavendors.xml was updated and Java has not been configured yet vos::OGuard aSolarGuard( Application::GetSolarMutex() ); m_bInvalidSettings_Handled = true; - //We first try to get the patch resource svp680xxx.res - //If the resource is not found then svt680xxx.res is used - ResId idWBX = SvtResId(WARNINGBOX_INVALIDJAVASETTINGS); - SvpResId pidPatchWBX(WARNINGBOX_INVALIDJAVASETTINGS); - pidPatchWBX.SetRT(RSC_WARNINGBOX); - ResMgr *pMgrWB = pidPatchWBX.GetResMgr(); - if (pMgrWB && pMgrWB->IsAvailable(pidPatchWBX)) - idWBX = pidPatchWBX; - WarningBox aWarningBox( NULL, idWBX); - - String aTitle; - SvpResId pidString(STR_WARNING_INVALIDJAVASETTINGS); - pidString.SetRT(RSC_STRING); - ResMgr *pmgr = pidString.GetResMgr(); - if ( pmgr && pmgr->IsAvailable(pidString)) - aTitle = String(pidString); - else - aTitle = String( SvtResId(STR_WARNING_INVALIDJAVASETTINGS)); - + WarningBox aWarningBox( NULL, SvtResId( WARNINGBOX_INVALIDJAVASETTINGS ) ); + String aTitle( SvtResId(STR_WARNING_INVALIDJAVASETTINGS)); aWarningBox.SetText( aTitle ); nResult = aWarningBox.Execute(); } @@ -216,28 +181,8 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque vos::OGuard aSolarGuard( Application::GetSolarMutex() ); m_bJavaDisabled_Handled = true; // Java disabled. Give user a chance to enable Java inside Office. - //We first try to get the patch resource svp680xxx.res - //If the resource is not found then svt680xxx.res is used - ResId idQBX = SvtResId( QBX_JAVADISABLED ); - SvpResId pidPatchQBX(QBX_JAVADISABLED); - pidPatchQBX.SetRT(RSC_QUERYBOX); - ResMgr *pMgrQB = pidPatchQBX.GetResMgr(); - - if (pMgrQB && pMgrQB->IsAvailable(pidPatchQBX)) - idQBX = pidPatchQBX; - - QueryBox aQueryBox(NULL, idQBX); - - String aTitle; - - SvpResId pidString(STR_QUESTION_JAVADISABLED); - pidString.SetRT(RSC_STRING); - ResMgr *pmgr = pidString.GetResMgr(); - if ( pmgr && pmgr->IsAvailable(pidString)) - aTitle = String(pidString); - else - aTitle = String( SvtResId( STR_QUESTION_JAVADISABLED )); - + QueryBox aQueryBox( NULL, SvtResId( QBX_JAVADISABLED ) ); + String aTitle( SvtResId( STR_QUESTION_JAVADISABLED ) ); aQueryBox.SetText( aTitle ); nResult = aQueryBox.Execute(); if ( nResult == RET_YES ) @@ -260,25 +205,8 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque // Java not correctly installed, or damaged vos::OGuard aSolarGuard( Application::GetSolarMutex() ); m_bVMCreationFailure_Handled = true; - //We first try to get the patch resource svp680xxx.res - //If the resource is not found then svt680xxx.res is used - ResId idEBX = SvtResId(ERRORBOX_JVMCREATIONFAILED); - SvpResId pidPatchEBX(ERRORBOX_JVMCREATIONFAILED); - pidPatchEBX.SetRT(RSC_ERRORBOX); - ResMgr *pMgrEB = pidPatchEBX.GetResMgr(); - if (pMgrEB && pMgrEB->IsAvailable(pidPatchEBX)) - idEBX = pidPatchEBX; - ErrorBox aErrorBox( NULL, idEBX); - - String aTitle; - SvpResId pidString(STR_ERROR_JVMCREATIONFAILED); - pidString.SetRT(RSC_STRING); - ResMgr *pmgr = pidString.GetResMgr(); - if ( pmgr && pmgr->IsAvailable(pidString)) - aTitle = String(pidString); - else - aTitle = String( SvtResId(STR_ERROR_JVMCREATIONFAILED)); - + ErrorBox aErrorBox( NULL, SvtResId( ERRORBOX_JVMCREATIONFAILED ) ); + String aTitle( SvtResId( STR_ERROR_JVMCREATIONFAILED ) ); aErrorBox.SetText( aTitle ); nResult = aErrorBox.Execute(); } @@ -295,25 +223,8 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque //before it can be used. vos::OGuard aSolarGuard( Application::GetSolarMutex() ); m_bRestartRequired_Handled = true; - //We first try to get the patch resource svp680xxx.res - //If the resource is not found then svt680xxx.res is used - ResId idEBX = SvtResId(ERRORBOX_RESTARTREQUIRED); - SvpResId pidPatchEBX(ERRORBOX_RESTARTREQUIRED); - pidPatchEBX.SetRT(RSC_ERRORBOX); - ResMgr *pMgrEB = pidPatchEBX.GetResMgr(); - if (pMgrEB && pMgrEB->IsAvailable(pidPatchEBX)) - idEBX = pidPatchEBX; - ErrorBox aErrorBox(NULL, idEBX); - - String aTitle; - SvpResId pidString(STR_ERROR_RESTARTREQUIRED); - pidString.SetRT(RSC_STRING); - ResMgr *pmgr = pidString.GetResMgr(); - if ( pmgr && pmgr->IsAvailable(pidString)) - aTitle = String(pidString); - else - aTitle = String( SvtResId(STR_ERROR_RESTARTREQUIRED)); - + ErrorBox aErrorBox(NULL, SvtResId( ERRORBOX_RESTARTREQUIRED ) ); + String aTitle( SvtResId( STR_ERROR_RESTARTREQUIRED ) ); aErrorBox.SetText( aTitle ); nResult = aErrorBox.Execute(); } diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx index 5beb55d72fb6..8058213e11bb 100644 --- a/svtools/source/misc/ehdl.cxx +++ b/svtools/source/misc/ehdl.cxx @@ -64,7 +64,7 @@ static USHORT aWndFunc( { - NAMESPACE_VOS( OGuard ) aGuard( Application::GetSolarMutex() ); + vos:: OGuard aGuard( Application::GetSolarMutex() ); // aus den Flags die benoetigten WinBits ermitteln WinBits eBits=0; @@ -377,7 +377,7 @@ BOOL SfxErrorHandler::GetErrorString( */ { - NAMESPACE_VOS( OGuard ) aGuard( Application::GetSolarMutex() ); + vos:: OGuard aGuard( Application::GetSolarMutex() ); BOOL bRet = FALSE; rStr=String(SvtResId(RID_ERRHDL_CLASS)); @@ -454,7 +454,7 @@ BOOL SfxErrorContext::GetString(ULONG nErrId, String &rStr) } if( pMgr ) { - NAMESPACE_VOS( OGuard ) aGuard( Application::GetSolarMutex() ); + vos:: OGuard aGuard( Application::GetSolarMutex() ); ResId aResId( nResId, *pMgr ); diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx index 25f23e2ef00b..4378e0acd234 100644 --- a/svtools/source/misc/imap.cxx +++ b/svtools/source/misc/imap.cxx @@ -57,10 +57,6 @@ UINT16 IMapObject::nActualTextEncoding = (UINT16) RTL_TEXTENCODING_DONTKNOW; /******************************************************************************/ -#ifdef WIN -#pragma optimize ( "", off ) -#endif - IMapObject::IMapObject() : bActive( false ) , nReadVersion( 0 ) @@ -1224,9 +1220,3 @@ void ImageMap::Read( SvStream& rIStm, const String& rBaseURL ) rIStm.SetNumberFormatInt( nOldFormat ); } - -#ifdef WIN -#pragma optimize ( "", on ) -#endif - - diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx index 9834fe0fcb76..587a31d4f098 100644 --- a/svtools/source/misc/imap2.cxx +++ b/svtools/source/misc/imap2.cxx @@ -28,9 +28,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svtools.hxx" -#ifdef WIN -#include <sysdep.hxx> -#endif #include <string.h> // #include <math.h> #include <vcl/svapp.hxx> @@ -48,9 +45,6 @@ #include <svtools/imapcirc.hxx> #include <svtools/imappoly.hxx> -#ifdef WIN -#include <sysdep.hxx> -#endif #include <string.h> #include <math.h> diff --git a/svtools/source/misc/svtdata.cxx b/svtools/source/misc/svtdata.cxx index eb97960afcda..495929bd89dc 100644 --- a/svtools/source/misc/svtdata.cxx +++ b/svtools/source/misc/svtdata.cxx @@ -61,25 +61,6 @@ ResMgr * ImpSvtData::GetResMgr() return GetResMgr(Application::GetSettings().GetUILocale()); } -ResMgr * ImpSvtData::GetPatchResMgr(const ::com::sun::star::lang::Locale& aLocale) -{ - if (!pPatchResMgr) - { - pPatchResMgr = ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(svp), aLocale); - } - return pPatchResMgr; -} - -ResMgr * ImpSvtData::GetPatchResMgr() -{ - return GetPatchResMgr(Application::GetSettings().GetUILocale()); -} - -SvpResId::SvpResId( USHORT nId ) : - ResId( nId, *ImpSvtData::GetSvtData().GetPatchResMgr() ) -{ -} - //============================================================================ // static ImpSvtData & ImpSvtData::GetSvtData() diff --git a/svtools/source/plugapp/testtool.src b/svtools/source/plugapp/testtool.src index 9cc52c58f013..e456200943f6 100644 --- a/svtools/source/plugapp/testtool.src +++ b/svtools/source/plugapp/testtool.src @@ -104,6 +104,7 @@ Bitmap TT_SHOW2 { }; WorkWindow TT_INLINE_TRANSLATION { + HelpID = "svtools:WorkWindow:TT_INLINE_TRANSLATION"; SVLook = TRUE; Size = MAP_APPFONT( 2*Control_Border + 4*ButtonWidth + 3*Button_Button, 120 ); Moveable = TRUE; @@ -116,6 +117,7 @@ WorkWindow TT_INLINE_TRANSLATION { Text[ en-US ] = "Translation"; }; Edit TT_E_NEW { + HelpID = "svtools:Edit:TT_INLINE_TRANSLATION:TT_E_NEW"; Disable = TRUE; Border = TRUE; Pos = MAP_APPFONT( 7, 16 ); @@ -134,6 +136,7 @@ WorkWindow TT_INLINE_TRANSLATION { Text[ en-US ] = "Comment"; }; Edit TT_E_COMMENT { + HelpID = "svtools:Edit:TT_INLINE_TRANSLATION:TT_E_COMMENT"; Disable = TRUE; Border = TRUE; Pos = MAP_APPFONT( 7, 64 ); @@ -142,12 +145,14 @@ WorkWindow TT_INLINE_TRANSLATION { Text[ en-US ] = "~Comment"; }; PushButton TT_PB_SELECT { + HelpID = "svtools:PushButton:TT_INLINE_TRANSLATION:TT_PB_SELECT"; Pos = MAP_APPFONT( Control_Border, 89 ); Size = MAP_APPFONT( ButtonWidth, 12 ); TabStop = TRUE; Text[ en-US ] = "~Select"; }; PushButton TT_PB_RESTORE { + HelpID = "svtools:PushButton:TT_INLINE_TRANSLATION:TT_PB_RESTORE"; Disable = TRUE; Pos = MAP_APPFONT( Control_Border + ButtonWidth + Button_Button, 89 ); Size = MAP_APPFONT( ButtonWidth, 12 ); @@ -155,6 +160,7 @@ WorkWindow TT_INLINE_TRANSLATION { Text[ en-US ] = "~Restore"; }; PushButton TT_PB_ACCEPT { + HelpID = "svtools:PushButton:TT_INLINE_TRANSLATION:TT_PB_ACCEPT"; Disable = TRUE; Pos = MAP_APPFONT( Control_Border + 2*(ButtonWidth + Button_Button), 89 ); Size = MAP_APPFONT( ButtonWidth, 12 ); @@ -162,6 +168,7 @@ WorkWindow TT_INLINE_TRANSLATION { Text[ en-US ] = "~Accept"; }; PushButton TT_PB_NEXT { + HelpID = "svtools:PushButton:TT_INLINE_TRANSLATION:TT_PB_NEXT"; Pos = MAP_APPFONT( Control_Border + 3*(ButtonWidth + Button_Button), 89 ); Size = MAP_APPFONT( ButtonWidth, 12 ); TabStop = TRUE; diff --git a/svtools/source/productregistration/makefile.mk b/svtools/source/productregistration/makefile.mk index a26e8feca753..b6e119601697 100644 --- a/svtools/source/productregistration/makefile.mk +++ b/svtools/source/productregistration/makefile.mk @@ -76,3 +76,11 @@ RESLIB1SRSFILES=\ .INCLUDE : target.mk + +ALLTAR : $(MISC)/productregistration.uno.component + +$(MISC)/productregistration.uno.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt productregistration.uno.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt productregistration.uno.component diff --git a/svtools/source/productregistration/productregistration.cxx b/svtools/source/productregistration/productregistration.cxx index 39629f5c3f77..cb3a9b7a7702 100644 --- a/svtools/source/productregistration/productregistration.cxx +++ b/svtools/source/productregistration/productregistration.cxx @@ -461,25 +461,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment ( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo ( - void * /* pServiceManager */, void * pRegistryKey) -{ - if (pRegistryKey) - { - Reference< XRegistryKey > xRegistryKey ( - reinterpret_cast< XRegistryKey* >( pRegistryKey )); - Reference< XRegistryKey > xNewKey; - - xNewKey = xRegistryKey->createKey( - OUString::createFromAscii( "/" PRODREG_IMPLNAME "/UNO/SERVICES" )); - xNewKey->createKey( - OUString::createFromAscii( PRODREG_SERVNAME )); - - return sal_True; - } - return sal_False; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */) { diff --git a/svtools/source/productregistration/productregistration.uno.component b/svtools/source/productregistration/productregistration.uno.component new file mode 100644 index 000000000000..da2cfd37c483 --- /dev/null +++ b/svtools/source/productregistration/productregistration.uno.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.setup.ProductRegistration"> + <service name="com.sun.star.setup.ProductRegistration"/> + </implementation> +</component> diff --git a/svtools/source/productregistration/registrationdlg.src b/svtools/source/productregistration/registrationdlg.src index c4cdcbcbe3ec..64f1063f1ba3 100644 --- a/svtools/source/productregistration/registrationdlg.src +++ b/svtools/source/productregistration/registrationdlg.src @@ -72,6 +72,7 @@ ModalDialog DLG_REGISTRATION_REQUEST RadioButton RB_NOW { + HelpID = "svtools:RadioButton:DLG_REGISTRATION_REQUEST:RB_NOW"; Pos = MAP_APPFONT ( 33 , 41 ) ; Size = MAP_APPFONT ( 153 , 10 ) ; Text [ en-US ] = "Register now" ; @@ -79,18 +80,21 @@ ModalDialog DLG_REGISTRATION_REQUEST RadioButton RB_LATER { + HelpID = "svtools:RadioButton:DLG_REGISTRATION_REQUEST:RB_LATER"; Pos = MAP_APPFONT ( 33 , 54 ) ; Size = MAP_APPFONT ( 153 , 10 ) ; Text [ en-US ] = "Remind me to register later" ; }; RadioButton RB_NEVER { + HelpID = "svtools:RadioButton:DLG_REGISTRATION_REQUEST:RB_NEVER"; Pos = MAP_APPFONT ( 33 , 67 ) ; Size = MAP_APPFONT ( 153 , 10 ) ; Text [ en-US ] = "Never register" ; }; RadioButton RB_DONE { + HelpID = "svtools:RadioButton:DLG_REGISTRATION_REQUEST:RB_DONE"; Pos = MAP_APPFONT ( 33 , 80 ) ; Size = MAP_APPFONT ( 153 , 20 ) ; WordBreak = TRUE; diff --git a/svtools/source/table/defaultinputhandler.cxx b/svtools/source/table/defaultinputhandler.cxx index ad8f7a7562d3..f6a58ad17efe 100644 --- a/svtools/source/table/defaultinputhandler.cxx +++ b/svtools/source/table/defaultinputhandler.cxx @@ -173,6 +173,7 @@ namespace svt { namespace table if ( ( pActions->nKeyCode == nKeyCode ) && ( pActions->nKeyModifier == rKeyCode.GetAllModifier() ) ) { bHandled = _rControl.dispatchAction( pActions->eAction ); + bHandled = true; // always handled issue #i114340 break; } } diff --git a/svtools/source/table/tabledatawindow.cxx b/svtools/source/table/tabledatawindow.cxx index e2e1ce5353fe..bbd7f6829369 100644 --- a/svtools/source/table/tabledatawindow.cxx +++ b/svtools/source/table/tabledatawindow.cxx @@ -45,7 +45,6 @@ namespace svt { namespace table TableDataWindow::TableDataWindow( TableControl_Impl& _rTableControl ) :Window( &_rTableControl.getAntiImpl() ) ,m_rTableControl ( _rTableControl ) - ,m_nRowAlreadySelected( -1 ) { // by default, use the background as determined by the style settings const Color aWindowColor( GetSettings().GetStyleSettings().GetFieldColor() ); @@ -110,15 +109,17 @@ namespace svt { namespace table { Point aPoint = rMEvt.GetPosPixel(); RowPos nCurRow = m_rTableControl.getCurrentRow(aPoint); + std::vector<RowPos> selectedRows(m_rTableControl.getSelectedRows()); if ( !m_rTableControl.getInputHandler()->MouseButtonDown( m_rTableControl, rMEvt ) ) Window::MouseButtonDown( rMEvt ); else { if(nCurRow >= 0 && m_rTableControl.getSelEngine()->GetSelectionMode() != NO_SELECTION) { - if( m_nRowAlreadySelected != nCurRow ) + bool found = std::find(selectedRows.begin(),selectedRows.end(), nCurRow) != selectedRows.end(); + + if( !found ) { - m_nRowAlreadySelected = nCurRow; m_aSelectHdl.Call( NULL ); } } diff --git a/svtools/source/toolpanel/drawerlayouter.cxx b/svtools/source/toolpanel/drawerlayouter.cxx index 040f33045fff..7fc7d05ea0c9 100644 --- a/svtools/source/toolpanel/drawerlayouter.cxx +++ b/svtools/source/toolpanel/drawerlayouter.cxx @@ -165,7 +165,7 @@ namespace svt OSL_PRECOND( i_nPosition <= m_aDrawers.size(), "DrawerDeckLayouter::PanelInserted: inconsistency!" ); PToolPanelDrawer pDrawer( new ToolPanelDrawer( m_rParentWindow, i_pPanel->GetDisplayName() ) ); - pDrawer->SetSmartHelpId( i_pPanel->GetHelpID() ); + pDrawer->SetHelpId( i_pPanel->GetHelpID() ); // proper Z-Order if ( i_nPosition == 0 ) { diff --git a/svtools/source/toolpanel/dummypanel.cxx b/svtools/source/toolpanel/dummypanel.cxx index 20f140a6e610..4de38b7f4bb3 100644 --- a/svtools/source/toolpanel/dummypanel.cxx +++ b/svtools/source/toolpanel/dummypanel.cxx @@ -80,9 +80,9 @@ namespace svt } //-------------------------------------------------------------------- - SmartId DummyPanel::GetHelpID() const + rtl::OString DummyPanel::GetHelpID() const { - return SmartId(); + return rtl::OString(); } //-------------------------------------------------------------------- diff --git a/svtools/source/toolpanel/dummypanel.hxx b/svtools/source/toolpanel/dummypanel.hxx index adb98e52077e..d2ca4480fce5 100644 --- a/svtools/source/toolpanel/dummypanel.hxx +++ b/svtools/source/toolpanel/dummypanel.hxx @@ -49,7 +49,7 @@ namespace svt // IToolPanel virtual ::rtl::OUString GetDisplayName() const; virtual Image GetImage() const; - virtual SmartId GetHelpID() const; + virtual rtl::OString GetHelpID() const; virtual void Activate( Window& i_rParentWindow ); virtual void Deactivate(); virtual void SetSizePixel( const Size& i_rPanelWindowSize ); diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx index 38aee00c8f55..23067d3ee5d0 100755 --- a/svtools/source/toolpanel/paneltabbar.cxx +++ b/svtools/source/toolpanel/paneltabbar.cxx @@ -296,19 +296,18 @@ namespace svt const ControlState nState( lcl_ItemToControlState( i_nItemFlags ) ); TabitemValue tiValue; - ImplControlValue aControlValue( (void*)(&tiValue) ); - Region aBoundingRegion, aContentRegion; + Rectangle aBoundingRegion, aContentRegion; bool bNativeOK = getTargetDevice().GetNativeControlRegion( CTRL_TAB_ITEM, PART_ENTIRE_CONTROL, i_rContentArea, nState, - aControlValue, ::rtl::OUString(), + tiValue, ::rtl::OUString(), aBoundingRegion, aContentRegion ); (void)bNativeOK; OSL_ENSURE( bNativeOK, "NWFTabItemRenderer::calculateDecorations: GetNativeControlRegion not implemented for CTRL_TAB_ITEM?!" ); - return aBoundingRegion.GetBoundRect(); + return aBoundingRegion; } //------------------------------------------------------------------------------------------------------------------ @@ -322,9 +321,8 @@ namespace svt if ( i_nItemFlags & ITEM_POSITION_LAST ) tiValue.mnAlignment |= TABITEM_LAST_IN_GROUP; - ImplControlValue aControlValue( (void *)(&tiValue) ); - bool bNativeOK = getTargetDevice().DrawNativeControl( CTRL_TAB_ITEM, PART_ENTIRE_CONTROL, i_rContentRect, nState, aControlValue, rtl::OUString() ); + bool bNativeOK = getTargetDevice().DrawNativeControl( CTRL_TAB_ITEM, PART_ENTIRE_CONTROL, i_rContentRect, nState, tiValue, rtl::OUString() ); (void)bNativeOK; OSL_ENSURE( bNativeOK, "NWFTabItemRenderer::preRenderItem: inconsistent NWF implementation!" ); // IsNativeControlSupported returned true, previously, otherwise we would not be here ... diff --git a/svtools/source/uno/miscservices.cxx b/svtools/source/uno/miscservices.cxx index e16a1ecb56dc..34984976bf07 100644 --- a/svtools/source/uno/miscservices.cxx +++ b/svtools/source/uno/miscservices.cxx @@ -101,55 +101,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment ( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo ( - void * pServiceManager, void * _pRegistryKey ) -{ - if (_pRegistryKey) - { - Reference< XRegistryKey > xRegistryKey ( - reinterpret_cast< XRegistryKey* >( _pRegistryKey )); - Reference< XRegistryKey > xNewKey; - uno::Sequence< ::rtl::OUString > aServices; - - xNewKey = xRegistryKey->createKey ( - OUString::createFromAscii( "/com.sun.star.comp.svtools.OAddressBookSourceDialogUno/UNO/SERVICES" ) ); - xNewKey->createKey( - OUString::createFromAscii( "com.sun.star.ui.AddressBookSourceDialog" ) ); - - xNewKey = xRegistryKey->createKey ( - OUString::createFromAscii( "/com.sun.star.svtools.SvFilterOptionsDialog/UNO/SERVICES" ) ); - xNewKey->createKey ( - OUString::createFromAscii( "com.sun.star.ui.dialogs.FilterOptionsDialog" ) ); - - // GraphicProvider - xNewKey = reinterpret_cast< registry::XRegistryKey * >( _pRegistryKey )->createKey( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + - GraphicProvider::getImplementationName_Static() + - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) ); - - aServices = GraphicProvider::getSupportedServiceNames_Static(); - int i; - for( i = 0; i < aServices.getLength(); i++ ) - xNewKey->createKey( aServices.getConstArray()[ i ] ); - - // GraphicRendererVCL - xNewKey = reinterpret_cast< registry::XRegistryKey * >( _pRegistryKey )->createKey( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + - GraphicRendererVCL::getImplementationName_Static() + - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) ); - - aServices = ( GraphicRendererVCL::getSupportedServiceNames_Static() ); - for( i = 0; i < aServices.getLength(); i++ ) - xNewKey->createKey( aServices.getConstArray()[ i ] ); - - if ( !component_writeInfoHelper( reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ), reinterpret_cast< registry::XRegistryKey* >( _pRegistryKey ), serviceDecl ) ) - return false; - - return ::cppu::component_writeInfoHelper( pServiceManager, _pRegistryKey, s_aServiceEntries ); - } - return sal_False; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory ( const sal_Char * pImplementationName, void * _pServiceManager, void * pRegistryKey) { diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx index 22e37817eaf5..9e4c522dc8c4 100644 --- a/svtools/source/uno/toolboxcontroller.cxx +++ b/svtools/source/uno/toolboxcontroller.cxx @@ -803,7 +803,7 @@ sal_Bool SAL_CALL ToolboxController::convertFastPropertyValue( com::sun::star::u { case TOOLBARCONTROLLER_PROPHANDLE_SUPPORTSVISIABLE: { - sal_Bool aNewValue; + sal_Bool aNewValue(sal_False); aValue >>= aNewValue; if (aNewValue != m_bSupportVisiable) { diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx index 7fb1a007960f..d1ea854cce61 100644 --- a/svtools/source/uno/treecontrolpeer.cxx +++ b/svtools/source/uno/treecontrolpeer.cxx @@ -1322,6 +1322,21 @@ void TreeControlPeer::setProperty( const ::rtl::OUString& PropertyName, const An switch( GetPropertyId( PropertyName ) ) { + case BASEPROPERTY_HIDEINACTIVESELECTION: + { + sal_Bool bEnabled = sal_False; + if ( aValue >>= bEnabled ) + { + WinBits nStyle = rTree.GetWindowBits(); + if ( bEnabled ) + nStyle |= WB_HIDESELECTION; + else + nStyle &= ~WB_HIDESELECTION; + rTree.SetWindowBits( nStyle ); + } + } + break; + case BASEPROPERTY_TREE_SELECTIONTYPE: { SelectionType eSelectionType; @@ -1412,6 +1427,9 @@ Any TreeControlPeer::getProperty( const ::rtl::OUString& PropertyName ) throw(Ru UnoTreeListBoxImpl& rTree = getTreeListBoxOrThrow(); switch(nPropId) { + case BASEPROPERTY_HIDEINACTIVESELECTION: + return Any( ( rTree.GetWindowBits() & WB_HIDESELECTION ) != 0 ? sal_True : sal_False ); + case BASEPROPERTY_TREE_SELECTIONTYPE: { SelectionType eSelectionType; diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx index 1fd2c1c8ccd1..9ff37fbc2af4 100644 --- a/svtools/source/uno/unoiface.cxx +++ b/svtools/source/uno/unoiface.cxx @@ -1662,7 +1662,7 @@ void SVTXRoadmap::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds ) BASEPROPERTY_TEXT, 0); VCLXWindow::ImplGetPropertyIds( rIds, true ); - VCLXImageConsumer::ImplGetPropertyIds( rIds ); + VCLXGraphicControl::ImplGetPropertyIds( rIds ); } // ---------------------------------------------------- diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx index 53725116c0bf..97482ed9d540 100644 --- a/svtools/source/uno/unoimap.cxx +++ b/svtools/source/uno/unoimap.cxx @@ -204,6 +204,8 @@ PropertySetInfo* SvUnoImageMapObject::createPropertySetInfo( UINT16 nType ) SvUnoImageMapObject::SvUnoImageMapObject( UINT16 nType, const SvEventDescription* pSupportedMacroItems ) : PropertySetHelper( createPropertySetInfo( nType ) ), mnType( nType ) +, mbIsActive( true ) +, mnRadius( 0 ) { mpEvents = new SvMacroTableEventDescriptor( pSupportedMacroItems ); mpEvents->acquire(); @@ -212,6 +214,8 @@ SvUnoImageMapObject::SvUnoImageMapObject( UINT16 nType, const SvEventDescription SvUnoImageMapObject::SvUnoImageMapObject( const IMapObject& rMapObject, const SvEventDescription* pSupportedMacroItems ) : PropertySetHelper( createPropertySetInfo( rMapObject.GetType() ) ), mnType( rMapObject.GetType() ) +, mbIsActive( true ) +, mnRadius( 0 ) { maURL = rMapObject.GetURL(); maAltText = rMapObject.GetAltText(); diff --git a/svtools/source/uno/wizard/unowizard.cxx b/svtools/source/uno/wizard/unowizard.cxx index 9440c0e69f26..ea147c5979d3 100644 --- a/svtools/source/uno/wizard/unowizard.cxx +++ b/svtools/source/uno/wizard/unowizard.cxx @@ -42,6 +42,7 @@ #include <rtl/strbuf.hxx> #include <vos/mutex.hxx> #include <vcl/svapp.hxx> +#include <tools/urlobj.hxx> //...................................................................................................................... namespace svt { namespace uno @@ -206,11 +207,32 @@ namespace svt { namespace uno m_bInitialized = true; } + static rtl::OString lcl_getHelpId( const ::rtl::OUString& _rHelpURL ) + { + INetURLObject aHID( _rHelpURL ); + if ( aHID.GetProtocol() == INET_PROT_HID ) + return rtl::OUStringToOString( aHID.GetURLPath(), RTL_TEXTENCODING_UTF8 ); + else + return rtl::OUStringToOString( _rHelpURL, RTL_TEXTENCODING_UTF8 ); + } + + //------------------------------------------------------------------------ + static ::rtl::OUString lcl_getHelpURL( const rtl::OString& sHelpId ) + { + ::rtl::OUStringBuffer aBuffer; + ::rtl::OUString aTmp( sHelpId, sHelpId.getLength(), RTL_TEXTENCODING_UTF8 ); + INetURLObject aHID( aTmp ); + if ( aHID.GetProtocol() == INET_PROT_NOT_VALID ) + aBuffer.appendAscii( INET_HID_SCHEME ); + aBuffer.append( aTmp.getStr() ); + return aBuffer.makeStringAndClear(); + } + //-------------------------------------------------------------------- Dialog* Wizard::createDialog( Window* i_pParent ) { WizardShell* pDialog( new WizardShell( i_pParent, this, m_xController, m_aWizardSteps ) ); - pDialog->SetSmartHelpId( SmartId( m_sHelpURL ) ); + pDialog->SetHelpId( lcl_getHelpId( m_sHelpURL ) ); pDialog->setTitleBase( m_sTitle ); return pDialog; } @@ -219,7 +241,7 @@ namespace svt { namespace uno void Wizard::destroyDialog() { if ( m_pDialog ) - m_sHelpURL = m_pDialog->GetSmartHelpId().GetStr(); + m_sHelpURL = lcl_getHelpURL( m_pDialog->GetHelpId() ); Wizard_Base::destroyDialog(); } @@ -279,8 +301,7 @@ namespace svt { namespace uno if ( !m_pDialog ) return m_sHelpURL; - const SmartId aSmartId( m_pDialog->GetSmartHelpId() ); - return aSmartId.GetStr(); + return lcl_getHelpURL( m_pDialog->GetHelpId() ); } //------------------------------------------------------------------------------------------------------------------ @@ -292,7 +313,7 @@ namespace svt { namespace uno if ( !m_pDialog ) m_sHelpURL = i_HelpURL; else - m_pDialog->SetSmartHelpId( SmartId( i_HelpURL ) ); + m_pDialog->SetHelpId( lcl_getHelpId( i_HelpURL ) ); } //------------------------------------------------------------------------------------------------------------------ @@ -414,7 +435,7 @@ namespace svt { namespace uno ::osl::MutexGuard aGuard( m_aMutex ); WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_pDialog ); - ENSURE_OR_RETURN_FALSE( pWizardImpl, "Wizard::getCurrentPage: invalid dialog implementation!" ); + ENSURE_OR_RETURN( pWizardImpl, "Wizard::getCurrentPage: invalid dialog implementation!", Reference< XWizardPage >() ); return pWizardImpl->getCurrentWizardPage(); } diff --git a/svtools/util/hidother.src b/svtools/util/hidother.src index 77dd98115221..03aea7ebdf7e 100644 --- a/svtools/util/hidother.src +++ b/svtools/util/hidother.src @@ -57,3 +57,23 @@ hidspecial HID_PRINTDIALOG_TOFILE { HelpID = HID_PRINTDIALOG_TOFIL hidspecial HID_WIZARD_NEXT { HelpID = HID_WIZARD_NEXT; }; hidspecial HID_WIZARD_PREVIOUS { HelpID = HID_WIZARD_PREVIOUS; }; +hidspecial HID_FILEDLG_LINK_CB { HelpID = HID_FILEDLG_LINK_CB; }; +hidspecial HID_FILEDLG_PREVIEW_CB { HelpID = HID_FILEDLG_PREVIEW_CB; }; +hidspecial HID_FILEDLG_FILE { HelpID = HID_FILEDLG_FILE; }; +hidspecial HID_FILEDLG_MANAGER { HelpID = HID_FILEDLG_MANAGER; }; +hidspecial HID_FILEDLG_READ_ONLY { HelpID = HID_FILEDLG_READ_ONLY; }; +hidspecial HID_FILEDLG_STANDARD { HelpID = HID_FILEDLG_STANDARD; }; +hidspecial HID_FILEDLG_URL { HelpID = HID_FILEDLG_URL; }; +hidspecial HID_FILEDLG_USE_PASSWD { HelpID = HID_FILEDLG_USE_PASSWD; }; +hidspecial HID_FILEDLG_AUTOCOMPLETEBOX { HelpID = HID_FILEDLG_AUTOCOMPLETEBOX; }; +hidspecial HID_FILEDLG_SAVE_BTN { HelpID = HID_FILEDLG_SAVE_BTN; }; +hidspecial HID_FILEDLG_SAVE_FILENAME { HelpID = HID_FILEDLG_SAVE_FILENAME; }; +hidspecial HID_FILEDLG_SAVE_FILETYPE { HelpID = HID_FILEDLG_SAVE_FILETYPE; }; +hidspecial HID_FILEDLG_INSERT_BTN { HelpID = HID_FILEDLG_INSERT_BTN; }; +hidspecial HID_FILEDLG_PATH_BTN { HelpID = HID_FILEDLG_PATH_BTN; }; +hidspecial HID_FILEDLG_PATH_FILENAME { HelpID = HID_FILEDLG_PATH_FILENAME; }; +hidspecial HID_FILEDLG_FOLDER_BTN { HelpID = HID_FILEDLG_FOLDER_BTN; }; +hidspecial HID_FILEDLG_FOLDER_FILENAME { HelpID = HID_FILEDLG_FOLDER_FILENAME; }; +hidspecial HID_FILEDLG_SRCHFOLDER_BTN { HelpID = HID_FILEDLG_SRCHFOLDER_BTN; }; +hidspecial HID_FILEDLG_EDIT_FAVORITES_LISTBOX { HelpID = HID_FILEDLG_EDIT_FAVORITES_LISTBOX; }; +hidspecial HID_FILEDLG_EDIT_FAVORITES_HEADERBAR { HelpID = HID_FILEDLG_EDIT_FAVORITES_HEADERBAR; }; diff --git a/svtools/util/makefile.mk b/svtools/util/makefile.mk index 4978666e633f..3a9429cf3735 100644 --- a/svtools/util/makefile.mk +++ b/svtools/util/makefile.mk @@ -185,3 +185,11 @@ ALL: $(SLB)$/svt.lib \ .INCLUDE : target.mk + +ALLTAR : $(MISC)/svt.component + +$(MISC)/svt.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + svt.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt svt.component diff --git a/svtools/util/svt.component b/svtools/util/svt.component new file mode 100644 index 000000000000..e15970547a38 --- /dev/null +++ b/svtools/util/svt.component @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.graphic.GraphicProvider"> + <service name="com.sun.star.graphic.GraphicProvider"/> + </implementation> + <implementation name="com.sun.star.comp.graphic.GraphicRendererVCL"> + <service name="com.sun.star.graphic.GraphicRendererVCL"/> + </implementation> + <implementation name="com.sun.star.comp.svtools.OAddressBookSourceDialogUno"> + <service name="com.sun.star.ui.AddressBookSourceDialog"/> + </implementation> + <implementation name="com.sun.star.comp.svtools.uno.Wizard"> + <service name="com.sun.star.ui.dialogs.Wizard"/> + </implementation> + <implementation name="com.sun.star.graphic.GraphicObject"> + <service name="com.sun.star.graphic.GraphicObject"/> + </implementation> + <implementation name="com.sun.star.svtools.SvFilterOptionsDialog"> + <service name="com.sun.star.ui.dialogs.FilterOptionsDialog"/> + </implementation> +</component> diff --git a/svtools/workben/toolpanel/toolpaneltest.cxx b/svtools/workben/toolpanel/toolpaneltest.cxx index 6d044cee7c93..6542fe826587 100755 --- a/svtools/workben/toolpanel/toolpaneltest.cxx +++ b/svtools/workben/toolpanel/toolpaneltest.cxx @@ -145,7 +145,7 @@ public: // IToolPanel virtual ::rtl::OUString GetDisplayName() const; virtual Image GetImage() const; - virtual SmartId GetHelpID() const; + virtual rtl::OString GetHelpID() const; virtual void Activate( Window& i_rParentWindow ); virtual void Deactivate(); virtual void SetSizePixel( const Size& i_rPanelWindowSize ); @@ -272,9 +272,9 @@ Image ColoredPanel::GetImage() const } //----------------------------------------------------------------------------- -SmartId ColoredPanel::GetHelpID() const +rtl::OString ColoredPanel::GetHelpID() const { - return SmartId(); + return rtl::OString(); } //============================================================================= diff --git a/svtools/workben/unodialog/roadmapskeleton.src b/svtools/workben/unodialog/roadmapskeleton.src index 797490273b5f..33728c700df6 100644 --- a/svtools/workben/unodialog/roadmapskeleton.src +++ b/svtools/workben/unodialog/roadmapskeleton.src @@ -31,6 +31,7 @@ // ----------------------------------------------------------------------------- ModalDialog DLG_ROADMAP_SKELETON { + HelpID = "svtools:ModalDialog:DLG_ROADMAP_SKELETON"; OutputSize = TRUE ; Moveable = TRUE; Closeable = TRUE ; @@ -61,24 +62,28 @@ ModalDialog DLG_ROADMAP_SKELETON TabPage TP_WELCOME { + HelpID = "svtools:TabPage:TP_WELCOME"; Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT ); Hide = TRUE; }; TabPage TP_PREPARE { + HelpID = "svtools:TabPage:TP_PREPARE"; Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT ); Hide = TRUE; }; TabPage TP_SETUP { + HelpID = "svtools:TabPage:TP_SETUP"; Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT ); Hide = TRUE; }; TabPage TP_FINISH { + HelpID = "svtools:TabPage:TP_FINISH"; Size = MAP_APPFONT( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT ); Hide = TRUE; }; |