diff options
Diffstat (limited to 'svtools')
138 files changed, 3987 insertions, 3985 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/fileview.hxx b/svtools/inc/fileview.hxx index 969efc228ae9..cf1c624a2488 100644 --- a/svtools/inc/fileview.hxx +++ b/svtools/inc/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/fltdefs.hxx b/svtools/inc/fltdefs.hxx index fcfc76026eb9..ee76739fb8c7 100644 --- a/svtools/inc/fltdefs.hxx +++ b/svtools/inc/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 sal_uInt8 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 ( sal_uIntPtr i = 0; i < nCount; i++ )\ - *pTmp++ = cByte; \ -} - -#else - typedef sal_uInt8* PDIBBYTE; #define MEMCPY memcpy #define MEMSET memset @@ -75,7 +60,6 @@ typedef sal_uInt8* PDIBBYTE; #define GLOBALFREE(pPointer) (GlobalFree((HGLOBAL)pPointer)) #define GLOBALHANDLE(pPointer) ((HGLOBAL)(pPointer)) -#endif #else typedef sal_uInt8* PDIBBYTE; diff --git a/svtools/inc/rtfout.hxx b/svtools/inc/rtfout.hxx index 36096e1257f1..2b34ccb5971b 100644 --- a/svtools/inc/rtfout.hxx +++ b/svtools/inc/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/accessibletable.hxx b/svtools/inc/svtools/accessibletable.hxx index 8d363f180777..1d7e5441ad65 100755..100644 --- a/svtools/inc/svtools/accessibletable.hxx +++ b/svtools/inc/svtools/accessibletable.hxx @@ -124,7 +124,7 @@ public: virtual ::com::sun::star::uno::Any GetCellContent( sal_Int32 _nRowPos, sal_Int32 _nColPos) const = 0; virtual std::vector<sal_Int32>& GetSelectedRows() = 0; virtual void RemoveSelectedRow(sal_Int32 _nRowPos) = 0; - virtual ::rtl::OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) = 0; + virtual ::rtl::OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) const = 0; }; // ---------------------------------------------------------------------------- diff --git a/svtools/inc/svtools/filter.hxx b/svtools/inc/svtools/filter.hxx index 0461cc6a9272..b5c380b8651c 100644 --- a/svtools/inc/svtools/filter.hxx +++ b/svtools/inc/svtools/filter.hxx @@ -134,16 +134,6 @@ class Graphic; #define GFF_EMF ( (sal_uInt16)0x00f8 ) #define GFF_XXX ( (sal_uInt16)0xffff ) -// --------------- -// - RequestInfo - -// --------------- - -struct RequestInfo -{ - sal_uInt8* pBuffer; - sal_uIntPtr 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; - sal_uIntPtr nStmPos; sal_uInt16 nBitsPerPixel; sal_uInt16 nPlanes; sal_uInt16 nFormat; sal_Bool bCompressed; - sal_Bool bDataReady; - sal_Bool bLinked; - sal_Bool bLinkChanged; - sal_Bool bWideSearch; - sal_Bool bBaseStm; - long nExtra1; - long nExtra2; + sal_Bool bOwnStream; void ImpConstruct(); -//#if 0 // _SOLAR__PRIVATE - sal_Bool ImpDetectBMP( SvStream& rStm, sal_Bool bExtendedInfo ); sal_Bool ImpDetectGIF( SvStream& rStm, sal_Bool bExtendedInfo ); sal_Bool ImpDetectJPG( SvStream& rStm, sal_Bool bExtendedInfo ); @@ -199,27 +178,11 @@ class SVT_DLLPUBLIC GraphicDescriptor sal_Bool ImpDetectSGV( SvStream& rStm, sal_Bool bExtendedInfo ); sal_Bool ImpDetectEMF( SvStream& rStm, sal_Bool bExtendedInfo ); -//#endif - GraphicDescriptor( const GraphicDescriptor& ); GraphicDescriptor& operator=( const GraphicDescriptor& ); -protected: - - sal_Bool IsDataReady() const; - sal_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 sal_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 sal_uInt8-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 - sal_uIntPtr GetRequestedByteCount() const; - // gibt die Filternummer des Filters zurueck, // der im GraphicFilter zum Lesen dieses Formats // benoetigt wird diff --git a/svtools/inc/svtools/headbar.hxx b/svtools/inc/svtools/headbar.hxx index c52d37fb9745..dfb4f9ffc927 100644 --- a/svtools/inc/svtools/headbar.hxx +++ b/svtools/inc/svtools/headbar.hxx @@ -360,15 +360,15 @@ public: void SetHelpText( sal_uInt16 nItemId, const XubString& rText ); XubString GetHelpText( sal_uInt16 nItemId ) const; - void SetHelpId( sal_uInt16 nItemId, sal_uIntPtr nHelpId ); - sal_uIntPtr GetHelpId( sal_uInt16 nItemId ) const; + void SetHelpId( sal_uInt16 nItemId, const rtl::OString& nHelpId ); + rtl::OString GetHelpId( sal_uInt16 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( sal_uIntPtr nId ) { Window::SetHelpId( nId ); } - inline sal_uIntPtr 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 b7177bfc8fd2..fd96d0547240 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/logindlg.hxx b/svtools/inc/svtools/logindlg.hxx deleted file mode 100644 index d53253cc6e1d..000000000000 --- a/svtools/inc/svtools/logindlg.hxx +++ /dev/null @@ -1,118 +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 _SVTOOLS_LOGINDLG_HXX_ -#define _SVTOOLS_LOGINDLG_HXX_ - -#include "svtools/svtdllapi.h" -#include <svtools/stdctrl.hxx> -#ifndef _SV_BUTTON_HXX -#include <vcl/button.hxx> -#endif -#include <vcl/dialog.hxx> -#include <vcl/edit.hxx> -#include <vcl/fixed.hxx> - -//============================================================================ -#define LF_NO_PATH 0x0001 // hide "path" -#define LF_NO_USERNAME 0x0002 // hide "name" -#define LF_NO_PASSWORD 0x0004 // hide "password" -#define LF_NO_SAVEPASSWORD 0x0008 // hide "save password" -#define LF_NO_ERRORTEXT 0x0010 // hide message -#define LF_PATH_READONLY 0x0020 // "path" readonly -#define LF_USERNAME_READONLY 0x0040 // "name" readonly -#define LF_NO_ACCOUNT 0x0080 // hide "account" - -//............................................................................ -namespace svt -{ -//............................................................................ - -//============================================================================ -class SVT_DLLPUBLIC LoginDialog : public ModalDialog -{ - FixedInfo aErrorInfo; - FixedLine aErrorGB; - FixedInfo aRequestInfo; - FixedText aPathFT; - Edit aPathED; - FixedInfo aPathInfo; - PushButton aPathBtn; - FixedText aNameFT; - Edit aNameED; - FixedInfo aNameInfo; - FixedText aPasswordFT; - Edit aPasswordED; - FixedText aAccountFT; - Edit aAccountED; - CheckBox aSavePasswdBtn; - FixedLine aLoginGB; - OKButton aOKBtn; - CancelButton aCancelBtn; - HelpButton aHelpBtn; - - SVT_DLLPRIVATE void HideControls_Impl( sal_uInt16 nFlags ); - - DECL_DLLPRIVATE_LINK( OKHdl_Impl, OKButton * ); - DECL_DLLPRIVATE_LINK( PathHdl_Impl, PushButton * ); - -public: - LoginDialog( Window* pParent, sal_uInt16 nFlags, - const String& rServer, const String* pRealm = NULL ); - - String GetPath() const { return aPathED.GetText(); } - void SetPath( const String& rNewPath ) - { aPathED.SetText( rNewPath ); - aPathInfo.SetText( rNewPath );} - String GetName() const { return aNameED.GetText(); } - void SetName( const String& rNewName ); - String GetPassword() const { return aPasswordED.GetText(); } - void SetPassword( const String& rNew ) - { aPasswordED.SetText( rNew ); } - String GetAccount() const { return aAccountED.GetText(); } - void SetAccount( const String& rNew ) - { aAccountED.SetText( rNew ); } - sal_Bool IsSavePassword() const - { return aSavePasswdBtn.IsChecked(); } - void SetSavePassword( sal_Bool bSave ) - { aSavePasswdBtn.Check( bSave ); } - void SetSavePasswordText( const String& rTxt ) - { aSavePasswdBtn.SetText( rTxt ); } - void SetErrorText( const String& rTxt ) - { aErrorInfo.SetText( rTxt ); } - void SetLoginRequestText( const String& rTxt ) - { aRequestInfo.SetText( rTxt ); } - void ClearPassword(); - void ClearAccount(); -}; - -//............................................................................ -} // namespace svt -//............................................................................ - -#endif // _SVTOOLS_LOGINDLG_HXX_ - diff --git a/svtools/inc/svtools/parrtf.hxx b/svtools/inc/svtools/parrtf.hxx index 1b64e7251aad..212fe9cafaed 100644 --- a/svtools/inc/svtools/parrtf.hxx +++ b/svtools/inc/svtools/parrtf.hxx @@ -30,7 +30,7 @@ #include "svtools/svtdllapi.h" #include <svtools/svparser.hxx> -#include <svl/svarray.hxx> +#include <stack> struct RtfParserState_Impl { @@ -42,7 +42,7 @@ struct RtfParserState_Impl {} }; -SV_DECL_VARARR( RtfParserStates_Impl, RtfParserState_Impl, 16, 16 ) +typedef std::stack< RtfParserState_Impl > RtfParserStates_Impl; class SVT_DLLPUBLIC SvRTFParser : public SvParser { diff --git a/svtools/inc/svtools/roadmapwizard.hxx b/svtools/inc/svtools/roadmapwizard.hxx index e1e657fbc6b5..695caa654f8d 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/svlbitm.hxx b/svtools/inc/svtools/svlbitm.hxx index 018666a563a8..e6881e6ddb44 100644 --- a/svtools/inc/svtools/svlbitm.hxx +++ b/svtools/inc/svtools/svlbitm.hxx @@ -176,6 +176,8 @@ class SVT_DLLPUBLIC SvLBoxButton : public SvLBoxItem sal_uInt16 nItemFlags; sal_uInt16 nImgArrOffs; sal_uInt16 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 226743854273..eee8fe9dd175 100644 --- a/svtools/inc/svtools/svtdata.hxx +++ b/svtools/inc/svtools/svtdata.hxx @@ -40,11 +40,10 @@ class ImpSvtData public: SfxItemDesruptorList_Impl * pItemDesruptList; ResMgr * pResMgr; - ResMgr * pPatchResMgr; private: ImpSvtData(): - pItemDesruptList(0), pResMgr(0), pPatchResMgr(0) + pItemDesruptList(0), pResMgr(0) {} ~ImpSvtData(); @@ -52,25 +51,11 @@ 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(); }; //============================================================================ - -class SvpResId: public ResId -{ -public: - SvpResId( sal_uInt16 nId, const ::com::sun::star::lang::Locale aLocale ): - ResId( nId, *ImpSvtData::GetSvtData().GetResMgr( aLocale ) ) {} - - // VCL dependant, only available in SVT, not in SVL! - SvpResId( sal_uInt16 nId ); -}; - - class SvtResId: public ResId { public: diff --git a/svtools/inc/svtools/svtools.hrc b/svtools/inc/svtools/svtools.hrc index a57a0f5bb0fe..3dd2f0706a2e 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) @@ -289,17 +279,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 b13bf903d9c4..d88203fcbb37 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(sal_Bool bFont,sal_Bool bForeground,sal_Bool bBackground); sal_Bool IsCellFocusEnabled() const; diff --git a/svtools/inc/svtools/svxbox.hxx b/svtools/inc/svtools/svxbox.hxx index d0ae916c3128..5697f39a4ca7 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/syntaxhighlight.hxx b/svtools/inc/svtools/syntaxhighlight.hxx index ce0a6a303f6f..5539e97b7a4d 100644 --- a/svtools/inc/svtools/syntaxhighlight.hxx +++ b/svtools/inc/svtools/syntaxhighlight.hxx @@ -57,8 +57,6 @@ #include <tools/string.hxx> #include <tools/gen.hxx> -#include <svl/svarray.hxx> - // Token-Typen TT_... enum TokenTypes @@ -79,8 +77,7 @@ enum TokenTypes struct HighlightPortion { sal_uInt16 nBegin; sal_uInt16 nEnd; TokenTypes tokenType; }; - -SV_DECL_VARARR(HighlightPortions, HighlightPortion, 0, 16) +typedef std::vector<HighlightPortion> HighlightPortions; ///////////////////////////////////////////////////////////////////////// // Hilfsklasse zur Untersuchung von JavaScript-Modulen, zunaechst zum diff --git a/svtools/inc/svtools/table/abstracttablecontrol.hxx b/svtools/inc/svtools/table/abstracttablecontrol.hxx index 3feea5010ec6..9f8aab6a829e 100644 --- a/svtools/inc/svtools/table/abstracttablecontrol.hxx +++ b/svtools/inc/svtools/table/abstracttablecontrol.hxx @@ -116,6 +116,7 @@ namespace svt { namespace table /** returns selection engine*/ virtual SelectionEngine* getSelEngine() = 0; virtual void setCursorAtCurrentCell(const Point& rPoint) = 0; + virtual bool isTooltipActive() = 0; virtual rtl::OUString& setTooltip(const Point& rPoint ) = 0; virtual RowPos getCurrentRow(const Point& rPoint ) = 0; virtual void resizeColumn(const Point& rPoint ) = 0; diff --git a/svtools/inc/svtools/table/tablecontrol.hxx b/svtools/inc/svtools/table/tablecontrol.hxx index ed5b03af63a7..08461dcdec79 100644 --- a/svtools/inc/svtools/table/tablecontrol.hxx +++ b/svtools/inc/svtools/table/tablecontrol.hxx @@ -79,6 +79,7 @@ namespace svt { namespace table ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aText; Link m_aSelectHdl; bool m_bSelectionChanged; + bool m_bTooltip; public: ::std::auto_ptr< AccessibleTableControl_Impl > m_pAccessTable; @@ -217,12 +218,13 @@ namespace svt { namespace table virtual sal_Bool isAccessibleAlive( ) const; virtual void commitGridControlEvent( sal_Int16 _nEventId, const com::sun::star::uno::Any& _rNewValue, const com::sun::star::uno::Any& _rOldValue ); virtual void RemoveSelectedRow(RowPos _nRowPos); - virtual ::rtl::OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos); + virtual ::rtl::OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) const; ::com::sun::star::uno::Sequence< sal_Int32 >& getColumnsForTooltip(); ::com::sun::star::uno::Sequence< ::rtl::OUString >& getTextForTooltip(); void setTooltip(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aText, const ::com::sun::star::uno::Sequence< sal_Int32 >& nCols); void clearSelection(); void selectionChanged(bool _bChanged); + bool isTooltip(); protected: /// retrieves the XAccessible implementation associated with the GridControl instance diff --git a/svtools/inc/svtools/table/tabledatawindow.hxx b/svtools/inc/svtools/table/tabledatawindow.hxx index c9f96483d943..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; } @@ -74,6 +73,11 @@ namespace svt { namespace table virtual void CaptureMouse(); virtual void ReleaseMouse(); virtual long Notify(NotifyEvent& rNEvt); + virtual void SetControlBackground(const Color& rColor); + virtual void SetControlBackground(); + + void SetBackground(const Wallpaper& rColor); + void SetBackground(); }; //........................................................................ } } // namespace svt::table 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/source/filter.vcl/filter/fldll.cxx b/svtools/inc/svtools/xwindowitem.hxx index 7ba8b0f79c2c..7e639904245f 100644 --- a/svtools/source/filter.vcl/filter/fldll.cxx +++ b/svtools/inc/svtools/xwindowitem.hxx @@ -2,10 +2,13 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite * + * $RCSfile: chrtitem.hxx,v $ + * $Revision: 1.9 $ + * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -24,53 +27,44 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ +#ifndef _XWINDOWITEM_HXX_ +#define _XWINDOWITEM_HXX_ + -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svtools.hxx" +#include "svtools/svtdllapi.h" -#ifdef WIN -#include <svwin.h> +#include <svl/poolitem.hxx> +#include <toolkit/helper/vclunohelper.hxx> -// Statische DLL-Verwaltungs-Variablen -static HINSTANCE hDLLInst = 0; // HANDLE der DLL +#include <com/sun/star/awt/XWindow.hpp> +class Window; -/*************************************************************************** -|* -|* 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 ) +class SVT_DLLPUBLIC XWindowItem : public SfxPoolItem { -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xWin; - hDLLInst = hDLL; + // disallow use assignment operator + XWindowItem & operator = ( const XWindowItem & ); - return sal_True; -} +public: + TYPEINFO(); + XWindowItem(); + explicit XWindowItem( sal_uInt16 nWhich, Window * pWin ); + XWindowItem( sal_uInt16 nWhich, com::sun::star::uno::Reference< com::sun::star::awt::XWindow > & rxWin ); + XWindowItem( const XWindowItem &rItem ); + ~XWindowItem(); -/*************************************************************************** -|* -|* WEP() -|* -|* Beschreibung DLL-Deinitialisierung -|* Ersterstellung TH 05.05.93 -|* Letzte Aenderung TH 05.05.93 -|* -***************************************************************************/ + virtual SfxPoolItem* Clone(SfxItemPool* pPool = 0) const; + virtual int operator == ( const SfxPoolItem& rAttr ) const; -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} + Window * GetWindowPtr() const { return VCLUnoHelper::GetWindow( m_xWin ); } + com::sun::star::uno::Reference< com::sun::star::awt::XWindow > GetXWindow() const { return m_xWin; } +}; + +////////////////////////////////////////////////////////////////////// #endif diff --git a/svtools/inc/tabbar.hxx b/svtools/inc/tabbar.hxx index 04e6ec4b77ec..d5cbf7fc6aa1 100644 --- a/svtools/inc/tabbar.hxx +++ b/svtools/inc/tabbar.hxx @@ -320,9 +320,6 @@ typedef sal_uInt16 TabBarPageBits; // - TabBar-Types - // ---------------- -#define TABBAR_APPEND ((sal_uInt16)0xFFFF) -#define TABBAR_PAGE_NOTFOUND ((sal_uInt16)0xFFFF) - #define TABBAR_RENAMING_YES ((long)sal_True) #define TABBAR_RENAMING_NO ((long)sal_False) #define TABBAR_RENAMING_CANCEL ((long)2) @@ -400,6 +397,9 @@ private: DECL_DLLPRIVATE_LINK( ImplClickHdl, ImplTabButton* ); public: + static const sal_uInt16 APPEND; + static const sal_uInt16 PAGE_NOT_FOUND; + TabBar( Window* pParent, WinBits nWinStyle = WB_STDTABBAR ); virtual ~TabBar(); @@ -424,9 +424,14 @@ public: void InsertPage( sal_uInt16 nPageId, const XubString& rText, TabBarPageBits nBits = 0, - sal_uInt16 nPos = TABBAR_APPEND ); + sal_uInt16 nPos = TabBar::APPEND ); void RemovePage( sal_uInt16 nPageId ); void MovePage( sal_uInt16 nPageId, sal_uInt16 nNewPos ); + + Color GetTabBgColor( sal_uInt16 nPageId ) const; + void SetTabBgColor( sal_uInt16 nPageId, const Color& aTabBgColor ); + sal_Bool IsDefaultTabBgColor( sal_uInt16 nPageId ); + void Clear(); void EnablePage( sal_uInt16 nPageId, sal_Bool bEnable = sal_True ); @@ -453,7 +458,7 @@ public: void SelectPage( sal_uInt16 nPageId, sal_Bool bSelect = sal_True ); void SelectPageRange( sal_Bool bSelect = sal_False, sal_uInt16 nStartPos = 0, - sal_uInt16 nEndPos = TABBAR_APPEND ); + sal_uInt16 nEndPos = TabBar::APPEND ); sal_uInt16 GetSelectPage( sal_uInt16 nSelIndex = 0 ) const; sal_uInt16 GetSelectPageCount() const; sal_Bool IsPageSelected( sal_uInt16 nPageId ) const; @@ -511,8 +516,8 @@ public: XubString GetPageText( sal_uInt16 nPageId ) const; void SetHelpText( sal_uInt16 nPageId, const XubString& rText ); XubString GetHelpText( sal_uInt16 nPageId ) const; - void SetHelpId( sal_uInt16 nPageId, sal_uIntPtr nHelpId ); - sal_uIntPtr GetHelpId( sal_uInt16 nPageId ) const; + void SetHelpId( sal_uInt16 nPageId, const rtl::OString& nHelpId ); + rtl::OString GetHelpId( sal_uInt16 nPageId ) const; long GetSplitSize() const { return mnSplitSize; } long GetMinSize() const; @@ -521,9 +526,9 @@ public: { Window::SetHelpText( rText ); } XubString GetHelpText() const { return Window::GetHelpText(); }; - void SetHelpId( sal_uIntPtr nId ) - { Window::SetHelpId( nId ); } - sal_uIntPtr 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/taskbar.hxx b/svtools/inc/taskbar.hxx index 4fcca42cb3e1..71f028ae6e2f 100644 --- a/svtools/inc/taskbar.hxx +++ b/svtools/inc/taskbar.hxx @@ -268,8 +268,8 @@ private: Image maImage; XubString maQuickHelpText; XubString maHelpText; - sal_uIntPtr mnHelpId; - sal_uInt16 mnFlags; + rtl::OString maHelpId; + sal_uInt16 mnFlags; public: TaskStatusFieldItem(); @@ -289,10 +289,10 @@ public: const XubString& GetQuickHelpText() const { return maQuickHelpText; } void SetHelpText( const XubString& rStr ) { maHelpText = rStr; } const XubString& GetHelpText() const { return maHelpText; } - void SetHelpId( sal_uIntPtr nHelpId ) { mnHelpId = nHelpId; } - sal_uIntPtr GetHelpId() const { return mnHelpId; } + void SetHelpId( const rtl::OString& rHelpId ) { maHelpId = rHelpId; } + const rtl::OString& GetHelpId() const { return maHelpId; } void SetFlags( sal_uInt16 nFlags ) { mnFlags = nFlags; } - sal_uInt16 GetFlags() const { return mnFlags; } + sal_uInt16 GetFlags() const { return mnFlags; } const TaskStatusFieldItem& operator=( const TaskStatusFieldItem& rItem ); }; 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 b174c16779c5..20556726fe26 100644 --- a/svtools/source/brwbox/brwbox2.cxx +++ b/svtools/source/brwbox/brwbox2.cxx @@ -613,13 +613,6 @@ void BrowseBox::Resize() if (IsZoom()) nSBSize = (sal_uIntPtr)(nSBSize * (double)GetZoom()); - long nSize = pDataWin->GetPosPixel().Y(); - if( !getDataWindow()->bNoHScroll ) - nSize += aHScroll.GetSizePixel().Height(); - - if ( GetOutputSizePixel().Height() < nSize ) - return; - DoHideCursor( "Resize" ); sal_uInt16 nOldVisibleRows = (sal_uInt16)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1); diff --git a/svtools/source/config/menuoptions.cxx b/svtools/source/config/menuoptions.cxx index 7a0f59c6f925..28f52fe2b23b 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 ( sal_uInt16 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/fileview.cxx b/svtools/source/contnr/fileview.cxx index a7d6c5e085db..b40ef436d8ab 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -54,6 +54,9 @@ #include <vcl/waitobj.hxx> #include <com/sun/star/io/XPersist.hpp> #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/ucb/XCommandInfo.hpp> +#include <com/sun/star/beans/XPropertySetInfo.hpp> +#include <com/sun/star/beans/PropertyAttribute.hpp> #include <algorithm> #include <memory> @@ -100,7 +103,7 @@ using ::rtl::OUString; DECLARE_LIST( StringList_Impl, OUString* ) -#define ROW_HEIGHT 17 // the height of a row has to be a little higher than the bitmap +#define ROW_HEIGHT 17 // the height of a row has to be a little higher than the bitmap #define QUICK_SEARCH_TIMEOUT 1500 // time in mSec before the quicksearch string will be reseted namespace @@ -210,6 +213,7 @@ private: sal_Bool mbResizeDisabled : 1; sal_Bool mbAutoResize : 1; sal_Bool mbEnableDelete : 1; + sal_Bool mbEnableRename : 1; void DeleteEntries(); void DoQuickSearch( const xub_Unicode& rChar ); @@ -232,6 +236,7 @@ public: void EnableAutoResize() { mbAutoResize = sal_True; } void EnableDelete( sal_Bool bEnable ) { mbEnableDelete = bEnable; } + void EnableRename( sal_Bool bEnable ) { mbEnableRename = bEnable; } sal_Bool IsDeleteOrContextMenuEnabled() { return mbEnableDelete || IsContextMenuHandlingEnabled(); } Reference< XCommandEnvironment > GetCommandEnvironment() const { return mxCmdEnv; } @@ -299,11 +304,11 @@ inline const OUString& HashedEntry::GetName() const class HashedEntryList : protected List {// provides a list of _unique_ Entries protected: - inline HashedEntry* First(); - inline HashedEntry* Next(); - inline void Append( HashedEntry* pNewEntry ); + inline HashedEntry* First(); + inline HashedEntry* Next(); + inline void Append( HashedEntry* pNewEntry ); public: - virtual ~HashedEntryList(); + virtual ~HashedEntryList(); const HashedEntry* Find( const OUString& rNameToSearchFor ); const HashedEntry* Find( const HashedEntry& rToSearchFor ); @@ -338,7 +343,7 @@ HashedEntryList::~HashedEntryList() const HashedEntry* HashedEntryList::Find( const OUString& rRefName ) { // simple linear search, which should be fast enough for this purpose - HashedEntry aRef( rRefName ); + HashedEntry aRef( rRefName ); HashedEntry* pIter = First(); while( pIter && *pIter != aRef ) pIter = Next(); @@ -419,12 +424,12 @@ class NameTranslationList : protected HashedEntryList { // contains a list of substitutes of strings for a given folder (as URL) // explanation of the circumstances see in remarks for Init(); protected: - INetURLObject maTransFile; // URL of file with translation entries - HashedEntry maHashedURL; // for future purposes when dealing with a set of cached - // NameTranslationLists + INetURLObject maTransFile; // URL of file with translation entries + HashedEntry maHashedURL; // for future purposes when dealing with a set of cached + // NameTranslationLists private: const String maTransFileName; - void Init(); // reads the translation file and fills the (internal) list + void Init(); // reads the translation file and fills the (internal) list public: NameTranslationList( const INetURLObject& rBaseURL ); @@ -436,12 +441,12 @@ public: using List::operator!=; inline sal_Bool operator !=( const HashedEntry& rRef ) const; - const OUString* Translate( const OUString& rName ) const; + const OUString* Translate( const OUString& rName ) const; // returns NULL, if rName can't be found - inline void Update(); // clears list and init + inline void Update(); // clears list and init - inline const String& GetTransTableFileName() const; + inline const String& GetTransTableFileName() const; // returns the name for the file, which contains the translation strings }; @@ -463,7 +468,7 @@ void NameTranslationList::Init() if( aTestContent.isDocument() ) {// ... also tests the existence of maTransFile by throwing an Exception - const sal_Char* pSection = "TRANSLATIONNAMES"; + const sal_Char* pSection = "TRANSLATIONNAMES"; String aFsysName( maTransFile.getFSysPath( INetURLObject::FSYS_DETECT ) ); Config aConfig( aFsysName ); @@ -475,7 +480,7 @@ void NameTranslationList::Init() Insert( new NameTranslationEntry( aConfig.GetKeyName( nCnt ), aConfig.ReadKey( nCnt ) ) ); } } - catch( Exception& ) {} + catch( Exception const & ) {} } NameTranslationList::NameTranslationList( const INetURLObject& rBaseURL ): @@ -527,7 +532,7 @@ public: // IContentTitleTranslation virtual sal_Bool GetTranslation( const OUString& rOriginalName, OUString& rTranslatedName ) const; - void UpdateTranslationTable(); // reads the translation file again + void UpdateTranslationTable(); // reads the translation file again void SetActualFolder( const INetURLObject& rActualFolder ); const String* GetTransTableFileName() const; @@ -600,7 +605,7 @@ public: void OpenFolder_Impl(); // #83004# ------- - void ReplaceTabWithString( OUString& aValue ); + void ReplaceTabWithString( OUString& aValue ); void CreateDisplayText_Impl(); void CreateVector_Impl( const Sequence < OUString > &rList ); void SortFolderContent_Impl(); @@ -661,11 +666,13 @@ inline void SvtFileView_Impl::EnableDelete( sal_Bool bEnable ) inline sal_Bool SvtFileView_Impl::EnableNameReplacing( sal_Bool bEnable ) { + mpView->EnableRename( bEnable ); + sal_Bool bRet; if( mpView->IsDeleteOrContextMenuEnabled() ) { DBG_ASSERT( !mbReplaceNames, "SvtFileView_Impl::EnableNameReplacing(): state should be not possible!" ); - bRet = !bEnable; // only for enabling this is an unsuccessful result + bRet = !bEnable; // only for enabling this is an unsuccessful result } else { @@ -744,7 +751,8 @@ ViewTabListBox_Impl::ViewTabListBox_Impl( Window* pParentWin, mnSearchIndex ( 0 ), mbResizeDisabled ( sal_False ), mbAutoResize ( sal_False ), - mbEnableDelete ( sal_True ) + mbEnableDelete ( sal_True ), + mbEnableRename ( sal_True ) { Size aBoxSize = pParentWin->GetSizePixel(); @@ -824,7 +832,7 @@ void ViewTabListBox_Impl::Resize() mbResizeDisabled = sal_True; Point aPos = GetPosPixel(); SetPosSizePixel( Point( 0, aBarSize.Height() ), - Size( aBoxSize.Width(), aBoxSize.Height() - aBarSize.Height() ) ); + Size( aBoxSize.Width(), aBoxSize.Height() - aBarSize.Height() ) ); mbResizeDisabled = sal_False; } } @@ -870,20 +878,90 @@ void ViewTabListBox_Impl::KeyInput( const KeyEvent& rKEvt ) PopupMenu* ViewTabListBox_Impl::CreateContextMenu( void ) { - PopupMenu* pRet; - sal_Int32 nSelectedEntries = GetSelectionCount(); + bool bEnableDelete = mbEnableDelete; + bool bEnableRename = mbEnableRename; + + if ( bEnableDelete || bEnableRename ) + { + sal_Int32 nSelectedEntries = GetSelectionCount(); + bEnableDelete &= nSelectedEntries > 0; + bEnableRename &= nSelectedEntries == 1; + } - if ( nSelectedEntries ) + if ( bEnableDelete || bEnableRename ) { - pRet = new PopupMenu( SvtResId( RID_FILEVIEW_CONTEXTMENU ) ); - pRet->EnableItem( MID_FILEVIEW_DELETE, 0 < nSelectedEntries ); - pRet->EnableItem( MID_FILEVIEW_RENAME, 1 == nSelectedEntries ); + SvLBoxEntry* pEntry = FirstSelected(); + while ( pEntry ) + { + ::ucbhelper::Content aCnt; + try + { + OUString aURL( static_cast< SvtContentEntry * >( + pEntry->GetUserData() )->maURL ); + aCnt = ::ucbhelper::Content( aURL, mxCmdEnv ); + } + catch( Exception const & ) + { + bEnableDelete = bEnableRename = false; + } + + if ( bEnableDelete ) + { + try + { + Reference< XCommandInfo > aCommands = aCnt.getCommands(); + if ( aCommands.is() ) + bEnableDelete + = aCommands->hasCommandByName( + OUString::createFromAscii( "delete" ) ); + else + bEnableDelete = false; + } + catch( Exception const & ) + { + bEnableDelete = false; + } + } + + if ( bEnableRename ) + { + try + { + Reference< XPropertySetInfo > aProps = aCnt.getProperties(); + if ( aProps.is() ) + { + Property aProp + = aProps->getPropertyByName( + OUString::createFromAscii( "Title" ) ); + bEnableRename + = !( aProp.Attributes & PropertyAttribute::READONLY ); + } + else + bEnableRename = false; + } + catch( Exception const & ) + { + bEnableRename = false; + } + } + + pEntry = ( bEnableDelete || bEnableRename ) + ? NextSelected( pEntry ) + : 0; + } + } + + if ( bEnableDelete || bEnableRename ) + { + PopupMenu * pRet + = new PopupMenu( SvtResId( RID_FILEVIEW_CONTEXTMENU ) ); + pRet->EnableItem( MID_FILEVIEW_DELETE, bEnableDelete ); + pRet->EnableItem( MID_FILEVIEW_RENAME, bEnableRename ); pRet->RemoveDisabledEntries( sal_True, sal_True ); + return pRet; } - else - pRet = NULL; - return pRet; + return NULL; } // ----------------------------------------------------------------------- @@ -928,12 +1006,31 @@ void ViewTabListBox_Impl::DeleteEntries() aURL = ( (SvtContentEntry*)pCurEntry->GetUserData() )->maURL; if ( !aURL.Len() ) - return; + continue; + + bool canDelete = true; + try + { + ::ucbhelper::Content aCnt( aURL, mxCmdEnv ); + Reference< XCommandInfo > aCommands = aCnt.getCommands(); + if ( aCommands.is() ) + canDelete + = aCommands->hasCommandByName( + OUString::createFromAscii( "delete" ) ); + else + canDelete = false; + } + catch( Exception const & ) + { + canDelete = false; + } - INetURLObject aObj( aURL ); + if (!canDelete) + continue; // process next entry if ( eResult != svtools::QUERYDELETE_ALL ) { + INetURLObject aObj( aURL ); svtools::QueryDeleteDlg_Impl aDlg( NULL, aObj.GetName( INetURLObject::DECODE_WITH_CHARSET ) ); if ( sDialogPosition.Len() ) aDlg.SetWindowState( sDialogPosition ); @@ -979,22 +1076,44 @@ sal_Bool ViewTabListBox_Impl::EditedEntry( SvLBoxEntry* pEntry, try { + OUString aPropName = OUString::createFromAscii( "Title" ); + bool canRename = true; ::ucbhelper::Content aContent( aURL, mxCmdEnv ); - OUString aPropName = OUString::createFromAscii( "Title" ); - Any aValue; - aValue <<= OUString( rNewText ); - aContent.setPropertyValue( aPropName, aValue ); - mpParent->EntryRenamed( aURL, rNewText ); + try + { + Reference< XPropertySetInfo > aProps = aContent.getProperties(); + if ( aProps.is() ) + { + Property aProp = aProps->getPropertyByName( aPropName ); + canRename = !( aProp.Attributes & PropertyAttribute::READONLY ); + } + else + { + canRename = false; + } + } + catch ( Exception const & ) + { + canRename = false; + } - pData->maURL = aURL; - pEntry->SetUserData( pData ); + if ( canRename ) + { + Any aValue; + aValue <<= OUString( rNewText ); + aContent.setPropertyValue( aPropName, aValue ); + mpParent->EntryRenamed( aURL, rNewText ); - bRet = sal_True; + pData->maURL = aURL; + pEntry->SetUserData( pData ); + + bRet = sal_True; + } + } + catch( Exception const & ) + { } - catch( ::com::sun::star::ucb::ContentCreationException ) {} - catch( ::com::sun::star::ucb::CommandAbortedException ) {} - catch( ::com::sun::star::uno::Exception ) {} return bRet; } @@ -1095,12 +1214,12 @@ sal_Bool ViewTabListBox_Impl::Kill( const OUString& rContent ) ::ucbhelper::Content aCnt( rContent, mxCmdEnv ); aCnt.executeCommand( OUString::createFromAscii( "delete" ), makeAny( sal_Bool( sal_True ) ) ); } - catch( ::com::sun::star::ucb::CommandAbortedException& ) + catch( ::com::sun::star::ucb::CommandAbortedException const & ) { DBG_WARNING( "CommandAbortedException" ); bRet = sal_False; } - catch( ::com::sun::star::uno::Exception& ) + catch( Exception const & ) { DBG_WARNING( "Any other exception" ); bRet = sal_False; @@ -1314,7 +1433,7 @@ sal_Bool SvtFileView::GetParentURL( String& rParentURL ) const } } } - catch( ::com::sun::star::uno::Exception ) + catch( Exception const & ) { // perhaps an unkown url protocol (e.g. "private:newdoc") } @@ -1324,16 +1443,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 ); } // ----------------------------------------------------------------------- @@ -1366,7 +1485,7 @@ sal_Bool SvtFileView::Initialize( const ::com::sun::star::uno::Reference< ::com: mpImp->FilterFolderContent_Impl( rFilter ); - mpImp->SortFolderContent_Impl(); // possibly not necessary!!!!!!!!!! + mpImp->SortFolderContent_Impl(); // possibly not necessary!!!!!!!!!! mpImp->CreateDisplayText_Impl(); mpImp->OpenFolder_Impl(); @@ -1999,7 +2118,7 @@ void SvtFileView_Impl::FilterFolderContent_Impl( const OUString &rFilter ) { // normalize the content title (we always match case-insensitive) // 91872 - 11.09.2001 - frank.schoenheit@sun.com - sCompareString = (*aContentLoop)->GetFileName(); // filter works on file name, not on title! + sCompareString = (*aContentLoop)->GetFileName(); // filter works on file name, not on title! sal_Bool bDelete; if( bHideTransFile && sCompareString == sHideEntry ) @@ -2643,12 +2762,12 @@ QueryDeleteDlg_Impl::QueryDeleteDlg_Impl ModalDialog( pParent, SvtResId( DLG_SVT_QUERYDELETE ) ), - _aEntryLabel ( this, SvtResId( TXT_ENTRY ) ), - _aEntry ( this, SvtResId( TXT_ENTRYNAME ) ), - _aQueryMsg ( this, SvtResId( TXT_QUERYMSG ) ), - _aYesButton ( this, SvtResId( BTN_YES ) ), - _aAllButton ( this, SvtResId( BTN_ALL ) ), - _aNoButton ( this, SvtResId( BTN_NO ) ), + _aEntryLabel ( this, SvtResId( TXT_ENTRY ) ), + _aEntry ( this, SvtResId( TXT_ENTRYNAME ) ), + _aQueryMsg ( this, SvtResId( TXT_QUERYMSG ) ), + _aYesButton ( this, SvtResId( BTN_YES ) ), + _aAllButton ( this, SvtResId( BTN_ALL ) ), + _aNoButton ( this, SvtResId( BTN_NO ) ), _aCancelButton( this, SvtResId( BTN_CANCEL ) ) { @@ -2671,12 +2790,6 @@ QueryDeleteDlg_Impl::QueryDeleteDlg_Impl // ----------------------------------------------------------------------- IMPL_STATIC_LINK( QueryDeleteDlg_Impl, ClickLink, PushButton*, pBtn ) - -/* [Beschreibung] - - Die Methode wertet das Resultat der Abfrage aus. -*/ - { if ( pBtn == &pThis->_aYesButton ) pThis->_eResult = QUERYDELETE_YES; 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 04d6cc44c78e..6b472465d400 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 e7e4010852dd..8336e29a8ff6 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -1067,14 +1067,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; + } } @@ -2172,14 +2172,6 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt ) SelAllDestrAnch( sal_False, sal_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 cbdcf3aac007..89f94bd531d4 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 61a87bc51cc4..89e888de0318 100644 --- a/svtools/source/contnr/svlbitm.cxx +++ b/svtools/source/contnr/svlbitm.cxx @@ -406,7 +406,7 @@ sal_Bool SvLBoxButton::ClickHdl( SvLBox*, SvLBoxEntry* pEntry ) } void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /* nFlags */, - SvLBoxEntry* ) + SvLBoxEntry* /*pEntry*/ ) { DBG_CHKTHIS(SvLBoxButton,0); sal_uInt16 nIndex = eKind == SvLBoxButtonKind_staticImage @@ -418,14 +418,13 @@ void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /* nFlags //Native drawing /// sal_Bool bNativeOK = sal_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, sal_uInt16 /* 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 ca3cc91a1ec9..494bcfe28ad5 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 b54e674429cc..ac4ca35a67ac 100644 --- a/svtools/source/contnr/svtreebx.cxx +++ b/svtools/source/contnr/svtreebx.cxx @@ -1814,7 +1814,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,sal_uInt16 nTabFl 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(sal_Bool bFont,sal_Bool bForeground,sal_Bool bBackground) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); diff --git a/svtools/source/contnr/templwin.src b/svtools/source/contnr/templwin.src index 048d052c18d8..45f9803539a1 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 88fe53e2bf10..9e62f37d097b 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 100755 index 62489f1b83d2..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 sal_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 ba4ca513dd3d..f4da39f60096 100755 --- a/svtools/source/control/headbar.cxx +++ b/svtools/source/control/headbar.cxx @@ -53,7 +53,7 @@ struct ImplHeadItem sal_uInt16 mnId; HeaderBarItemBits mnBits; long mnSize; - sal_uIntPtr 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 ) { - sal_uIntPtr 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( sal_uInt16 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( sal_uInt16 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( sal_uInt16 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( sal_uInt16 nItemId ) const // ----------------------------------------------------------------------- -void HeaderBar::SetHelpId( sal_uInt16 nItemId, sal_uIntPtr nHelpId ) +void HeaderBar::SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId ) { sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != HEADERBAR_ITEM_NOTFOUND ) - mpItemList->GetObject( nPos )->mnHelpId = nHelpId; + mpItemList->GetObject( nPos )->maHelpId = rHelpId; } // ----------------------------------------------------------------------- -sal_uIntPtr HeaderBar::GetHelpId( sal_uInt16 nItemId ) const +rtl::OString HeaderBar::GetHelpId( sal_uInt16 nItemId ) const { sal_uInt16 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 e6b526473d35..51f9a45a3961 100755 --- a/svtools/source/control/inettbc.cxx +++ b/svtools/source/control/inettbc.cxx @@ -858,7 +858,7 @@ SvtURLBox::SvtURLBox( Window* pParent, const ResId& _rResId, INetProtocol eSmart void SvtURLBox::ImplInit() { pImp = new SvtURLBox_Impl(); - SetHelpId( SID_OPENURL ); + SetHelpId( ".uno:OpenURL" ); EnableAutocomplete( sal_False ); SetText( String() ); diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index b93de91abf87..481a87633315 100755 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -39,6 +39,8 @@ #include <vcl/edit.hxx> #include "svtaccessiblefactory.hxx" +#include <limits> + // ======================================================================= #define TABBAR_OFFSET_X 7 @@ -58,10 +60,14 @@ struct ImplTabBarItem XubString maHelpText; Rectangle maRect; long mnWidth; - sal_uIntPtr mnHelpId; + rtl::OString maHelpId; sal_Bool mbShort; sal_Bool mbSelect; sal_Bool mbEnable; + Color maTabBgColor; + bool IsDefaultTabBgColor() const { return maTabBgColor == Color(COL_AUTO) ? sal_True : sal_False; }; + Color maTabTextColor; + bool IsDefaultTabTextColor() const { return maTabTextColor == Color(COL_AUTO) ? sal_True : sal_False; }; ImplTabBarItem( sal_uInt16 nItemId, const XubString& rText, TabBarPageBits nPageBits ) : @@ -70,10 +76,11 @@ struct ImplTabBarItem mnId = nItemId; mnBits = nPageBits; mnWidth = 0; - mnHelpId = 0; mbShort = sal_False; mbSelect = sal_False; mbEnable = sal_True; + maTabBgColor = Color( COL_AUTO ); + maTabTextColor = Color( COL_AUTO ); } }; @@ -348,6 +355,9 @@ struct TabBar_Impl // ======================================================================= +const sal_uInt16 TabBar::APPEND = ::std::numeric_limits<sal_uInt16>::max(); +const sal_uInt16 TabBar::PAGE_NOT_FOUND = ::std::numeric_limits<sal_uInt16>::max(); + void TabBar::ImplInit( WinBits nWinStyle ) { mpItemList = new ImplTabBarList; @@ -1046,7 +1056,8 @@ void TabBar::Paint( const Rectangle& ) // Font selektieren Font aFont = GetFont(); Font aLightFont = aFont; - aLightFont.SetWeight( WEIGHT_LIGHT ); + //aLightFont.SetWeight( WEIGHT_LIGHT ); //TODO Make font weight light on custom color only? + aLightFont.SetWeight( WEIGHT_NORMAL ); // #i36013# exclude push buttons from painting area Rectangle aClipRect( Point( mnOffX, 0 ), Point( mnLastOffX, GetOutputHeightPixel() - 1 ) ); @@ -1120,15 +1131,23 @@ void TabBar::Paint( const Rectangle& ) SetFont( aLightFont ); // Je nach Status die richtige FillInBrush setzen + // Set the correct FillInBrush depending upon status if ( pItem->mbSelect || (pItem->mnId == mnCurPageId) ) { + // Currently selected Tab SetFillColor( aSelectColor ); SetTextColor( aSelectTextColor ); } else { - SetFillColor( aFaceColor ); - SetTextColor( aFaceTextColor ); + if ( !pItem->IsDefaultTabBgColor() && !rStyleSettings.GetHighContrastMode() ) + { + SetFillColor( pItem->maTabBgColor ); + SetTextColor( pItem->maTabTextColor ); + } else { + SetFillColor( aFaceColor ); + SetTextColor( aFaceTextColor ); + } } // Muss Font Kursiv geschaltet werden @@ -1160,21 +1179,38 @@ void TabBar::Paint( const Rectangle& ) long nTextHeight = GetTextHeight(); Point aTxtPos( aRect.Left()+(aRectSize.Width()-nTextWidth)/2, (aRectSize.Height()-nTextHeight)/2 ); - if ( !pItem->mbEnable ) - DrawCtrlText( aTxtPos, aText, 0, STRING_LEN, (TEXT_DRAW_DISABLE | TEXT_DRAW_MNEMONIC) ); - else - DrawText( aTxtPos, aText ); - + if ( pItem->IsDefaultTabBgColor() || (!pItem->mbSelect) ) + { + if ( !pItem->mbEnable ) + DrawCtrlText( aTxtPos, aText, 0, STRING_LEN, (TEXT_DRAW_DISABLE | TEXT_DRAW_MNEMONIC) ); + else + DrawText( aTxtPos, aText ); + } // Jetzt im Inhalt den 3D-Effekt ausgeben aPos0.X()++; aPos1.X()++; aPos2.X()--; aPos3.X()--; - SetLineColor( rStyleSettings.GetLightColor() ); + + // If this is the current tab, draw the left inner shadow the default color, + // otherwise make it the same as the custom background color + if ( pItem->mbSelect || (pItem->mnId == mnCurPageId) ) { + SetLineColor( rStyleSettings.GetLightColor() ); + } else { + if ( !pItem->IsDefaultTabBgColor() && ! rStyleSettings.GetHighContrastMode() ) + { + SetLineColor( pItem->maTabBgColor ); + } else { + SetLineColor( rStyleSettings.GetLightColor() ); + } + } + // Draw the left side of the tab DrawLine( aPos0, aPos1 ); if ( !pItem->mbSelect && (pItem->mnId != mnCurPageId) ) { + // Draw the top inner shadow + // ToDo: Change from this static color to tab custom bg color DrawLine( Point( aPos0.X(), aPos0.Y()+1 ), Point( aPos3.X(), aPos3.Y()+1 ) ); } @@ -1184,8 +1220,27 @@ void TabBar::Paint( const Rectangle& ) aPos1.X()--; aPos1.Y()--; aPos2.Y()--; + if ( !pItem->IsDefaultTabBgColor() && ( pItem->mbSelect || (pItem->mnId == mnCurPageId) ) ) + { + SetLineColor( pItem->maTabBgColor ); + DrawLine( Point(aPos1.X()-1, aPos1.Y()-1), Point(aPos2.X(), aPos2.Y()-1) ); + } DrawLine( aPos1, aPos2 ); + // draw a small 2px sliver of the original background color at the bottom of the selected tab + + if ( !pItem->IsDefaultTabBgColor() ) + { + if ( pItem->mbSelect || (pItem->mnId == mnCurPageId) || rStyleSettings.GetHighContrastMode() ) { + SetLineColor( pItem->maTabBgColor ); + DrawLine( Point(aPos1.X()-1, aPos1.Y()-1), Point(aPos2.X(), aPos2.Y()-1) ); + if ( !pItem->mbEnable ) + DrawCtrlText( aTxtPos, aText, 0, STRING_LEN, (TEXT_DRAW_DISABLE | TEXT_DRAW_MNEMONIC) ); + else + DrawText( aTxtPos, aText ); + } + } + // Da etwas uebermalt werden konnte, muessen wir die Polygon- // umrandung nocheinmal ausgeben SetLineColor( rStyleSettings.GetDarkShadowColor() ); @@ -1338,13 +1393,13 @@ void TabBar::RequestHelp( const HelpEvent& rHEvt ) } else if ( rHEvt.GetMode() & HELPMODE_EXTENDED ) { - sal_uIntPtr 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; } } @@ -1540,7 +1595,7 @@ void TabBar::InsertPage( sal_uInt16 nPageId, const XubString& rText, TabBarPageBits nBits, sal_uInt16 nPos ) { DBG_ASSERT( nPageId, "TabBar::InsertPage(): PageId == 0" ); - DBG_ASSERT( GetPagePos( nPageId ) == TABBAR_PAGE_NOTFOUND, + DBG_ASSERT( GetPagePos( nPageId ) == PAGE_NOT_FOUND, "TabBar::InsertPage(): PageId already exists" ); DBG_ASSERT( nBits <= TPB_SPECIAL, "TabBar::InsertPage(): nBits is wrong" ); @@ -1562,12 +1617,47 @@ void TabBar::InsertPage( sal_uInt16 nPageId, const XubString& rText, // ----------------------------------------------------------------------- +Color TabBar::GetTabBgColor( sal_uInt16 nPageId ) const +{ + sal_uInt16 nPos = GetPagePos( nPageId ); + + if ( nPos != PAGE_NOT_FOUND ) + return mpItemList->GetObject( nPos )->maTabBgColor; + else + return Color( COL_AUTO ); +} + +void TabBar::SetTabBgColor( sal_uInt16 nPageId, const Color& aTabBgColor ) +{ + sal_uInt16 nPos = GetPagePos( nPageId ); + ImplTabBarItem* pItem; + if ( nPos != PAGE_NOT_FOUND ) + { + pItem = mpItemList->GetObject( nPos ); + if ( aTabBgColor != Color( COL_AUTO ) ) + { + pItem->maTabBgColor = aTabBgColor; + if ( aTabBgColor.GetLuminance() <= 128 ) //Do not use aTabBgColor.IsDark(), because that threshold is way too low... + pItem->maTabTextColor = Color( COL_WHITE ); + else + pItem->maTabTextColor = Color( COL_BLACK ); + } + else + { + pItem->maTabBgColor = Color( COL_AUTO ); + pItem->maTabTextColor = Color( COL_AUTO ); + } + } +} + +// ----------------------------------------------------------------------- + void TabBar::RemovePage( sal_uInt16 nPageId ) { sal_uInt16 nPos = GetPagePos( nPageId ); // Existiert Item - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) { if ( mnCurPageId == nPageId ) mnCurPageId = 0; @@ -1602,7 +1692,7 @@ void TabBar::MovePage( sal_uInt16 nPageId, sal_uInt16 nNewPos ) return; // Existiert Item - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) { // TabBar-Item in der Liste verschieben ImplTabBarItem* pItem = mpItemList->Remove( nPos ); @@ -1640,7 +1730,7 @@ void TabBar::Clear() if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); - CallEventListeners( VCLEVENT_TABBAR_PAGEREMOVED, (void*) TABBAR_PAGE_NOTFOUND ); + CallEventListeners( VCLEVENT_TABBAR_PAGEREMOVED, (void*) PAGE_NOT_FOUND ); } // ----------------------------------------------------------------------- @@ -1649,7 +1739,7 @@ void TabBar::EnablePage( sal_uInt16 nPageId, sal_Bool bEnable ) { sal_uInt16 nPos = GetPagePos( nPageId ); - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) { ImplTabBarItem* pItem = mpItemList->GetObject( nPos ); @@ -1672,7 +1762,7 @@ sal_Bool TabBar::IsPageEnabled( sal_uInt16 nPageId ) const { sal_uInt16 nPos = GetPagePos( nPageId ); - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) return mpItemList->GetObject( nPos )->mbEnable; else return sal_False; @@ -1684,7 +1774,7 @@ void TabBar::SetPageBits( sal_uInt16 nPageId, TabBarPageBits nBits ) { sal_uInt16 nPos = GetPagePos( nPageId ); - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) { ImplTabBarItem* pItem = mpItemList->GetObject( nPos ); @@ -1705,7 +1795,7 @@ TabBarPageBits TabBar::GetPageBits( sal_uInt16 nPageId ) const { sal_uInt16 nPos = GetPagePos( nPageId ); - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) return mpItemList->GetObject( nPos )->mnBits; else return sal_False; @@ -1742,7 +1832,7 @@ sal_uInt16 TabBar::GetPagePos( sal_uInt16 nPageId ) const pItem = mpItemList->Next(); } - return TABBAR_PAGE_NOTFOUND; + return PAGE_NOT_FOUND; } // ----------------------------------------------------------------------- @@ -1767,7 +1857,7 @@ Rectangle TabBar::GetPageRect( sal_uInt16 nPageId ) const { sal_uInt16 nPos = GetPagePos( nPageId ); - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) return mpItemList->GetObject( nPos )->maRect; else return Rectangle(); @@ -1780,7 +1870,7 @@ void TabBar::SetCurPageId( sal_uInt16 nPageId ) sal_uInt16 nPos = GetPagePos( nPageId ); // Wenn Item nicht existiert, dann nichts machen - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) { // Wenn sich aktuelle Page nicht geaendert hat, dann muessen wir // jetzt nichts mehr machen @@ -1872,7 +1962,7 @@ void TabBar::MakeVisible( sal_uInt16 nPageId ) sal_uInt16 nPos = GetPagePos( nPageId ); // Wenn Item nicht existiert, dann nichts machen - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) { if ( nPos < mnFirstPos ) SetFirstPageId( nPageId ); @@ -1921,7 +2011,7 @@ void TabBar::SetFirstPageId( sal_uInt16 nPageId ) sal_uInt16 nPos = GetPagePos( nPageId ); // Wenn Item nicht existiert, dann sal_False zurueckgeben - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) { if ( nPos != mnFirstPos ) { @@ -1955,7 +2045,7 @@ void TabBar::SelectPage( sal_uInt16 nPageId, sal_Bool bSelect ) { sal_uInt16 nPos = GetPagePos( nPageId ); - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) { ImplTabBarItem* pItem = mpItemList->GetObject( nPos ); @@ -2036,7 +2126,7 @@ sal_uInt16 TabBar::GetSelectPageCount() const sal_Bool TabBar::IsPageSelected( sal_uInt16 nPageId ) const { sal_uInt16 nPos = GetPagePos( nPageId ); - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) return mpItemList->GetObject( nPos )->mbSelect; else return sal_False; @@ -2047,7 +2137,7 @@ sal_Bool TabBar::IsPageSelected( sal_uInt16 nPageId ) const sal_Bool TabBar::StartEditMode( sal_uInt16 nPageId ) { sal_uInt16 nPos = GetPagePos( nPageId ); - if ( mpEdit || (nPos == TABBAR_PAGE_NOTFOUND) || (mnLastOffX < 8) ) + if ( mpEdit || (nPos == PAGE_NOT_FOUND) || (mnLastOffX < 8) ) return sal_False; mnEditId = nPageId; @@ -2268,7 +2358,7 @@ void TabBar::SetSelectTextColor( const Color& rColor ) void TabBar::SetPageText( sal_uInt16 nPageId, const XubString& rText ) { sal_uInt16 nPos = GetPagePos( nPageId ); - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) { mpItemList->GetObject( nPos )->maText = rText; mbSizeFormat = sal_True; @@ -2286,7 +2376,7 @@ void TabBar::SetPageText( sal_uInt16 nPageId, const XubString& rText ) XubString TabBar::GetPageText( sal_uInt16 nPageId ) const { sal_uInt16 nPos = GetPagePos( nPageId ); - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) return mpItemList->GetObject( nPos )->maText; else return XubString(); @@ -2297,7 +2387,7 @@ XubString TabBar::GetPageText( sal_uInt16 nPageId ) const void TabBar::SetHelpText( sal_uInt16 nPageId, const XubString& rText ) { sal_uInt16 nPos = GetPagePos( nPageId ); - if ( nPos != TABBAR_PAGE_NOTFOUND ) + if ( nPos != PAGE_NOT_FOUND ) mpItemList->GetObject( nPos )->maHelpText = rText; } @@ -2306,14 +2396,14 @@ void TabBar::SetHelpText( sal_uInt16 nPageId, const XubString& rText ) XubString TabBar::GetHelpText( sal_uInt16 nPageId ) const { sal_uInt16 nPos = GetPagePos( nPageId ); - if ( nPos != TABBAR_PAGE_NOTFOUND ) + 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; @@ -2324,22 +2414,22 @@ XubString TabBar::GetHelpText( sal_uInt16 nPageId ) const // ----------------------------------------------------------------------- -void TabBar::SetHelpId( sal_uInt16 nPageId, sal_uIntPtr nHelpId ) +void TabBar::SetHelpId( sal_uInt16 nPageId, const rtl::OString& rHelpId ) { sal_uInt16 nPos = GetPagePos( nPageId ); - if ( nPos != TABBAR_PAGE_NOTFOUND ) - mpItemList->GetObject( nPos )->mnHelpId = nHelpId; + if ( nPos != PAGE_NOT_FOUND ) + mpItemList->GetObject( nPos )->maHelpId = rHelpId; } // ----------------------------------------------------------------------- -sal_uIntPtr TabBar::GetHelpId( sal_uInt16 nPageId ) const +rtl::OString TabBar::GetHelpId( sal_uInt16 nPageId ) const { sal_uInt16 nPos = GetPagePos( nPageId ); - if ( nPos != TABBAR_PAGE_NOTFOUND ) - return mpItemList->GetObject( nPos )->mnHelpId; - else - return 0; + rtl::OString aRet; + if ( nPos != PAGE_NOT_FOUND ) + aRet = mpItemList->GetObject( nPos )->maHelpId; + return aRet; } // ----------------------------------------------------------------------- @@ -2483,9 +2573,12 @@ sal_uInt16 TabBar::ShowDropPos( const Point& rPos ) nX--; else nX++; + if ( !pItem->IsDefaultTabBgColor() && !pItem->mbSelect) + SetLineColor( pItem->maTabTextColor ); DrawLine( Point( nX, nY ), Point( nX, nY ) ); DrawLine( Point( nX+1, nY-1 ), Point( nX+1, nY+1 ) ); DrawLine( Point( nX+2, nY-2 ), Point( nX+2, nY+2 ) ); + SetLineColor( aBlackColor ); } if ( (mnDropPos > 0) && (mnDropPos < nItemCount+1) ) { @@ -2493,6 +2586,8 @@ sal_uInt16 TabBar::ShowDropPos( const Point& rPos ) nX = pItem->maRect.Right()-TABBAR_OFFSET_X; if ( mnDropPos == nCurPos ) nX++; + if ( !pItem->IsDefaultTabBgColor() && !pItem->mbSelect) + SetLineColor( pItem->maTabTextColor ); DrawLine( Point( nX, nY ), Point( nX, nY ) ); DrawLine( Point( nX-1, nY-1 ), Point( nX-1, nY+1 ) ); DrawLine( Point( nX-2, nY-2 ), Point( nX-2, nY+2 ) ); diff --git a/svtools/source/control/taskstat.cxx b/svtools/source/control/taskstat.cxx index 4b64a5c27ff3..892ccdc1be4e 100755 --- a/svtools/source/control/taskstat.cxx +++ b/svtools/source/control/taskstat.cxx @@ -517,13 +517,13 @@ void TaskStatusBar::RequestHelp( const HelpEvent& rHEvt ) { if ( pItem ) { - sal_uIntPtr 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 2dfc54f4ef54..c84eb17afecc 100644 --- a/svtools/source/control/toolbarmenu.cxx +++ b/svtools/source/control/toolbarmenu.cxx @@ -481,6 +481,9 @@ void ToolbarMenu::implInit(const Reference< XFrame >& rFrame) { mpImpl = new ToolbarMenu_Impl( *this, rFrame ); + const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); + SetControlBackground( rStyleSettings.GetMenuColor() ); + initWindow(); Window* pWindow = GetTopMostParentSystemWindow( this ); @@ -638,8 +641,6 @@ void ToolbarMenu::initWindow() { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); - SetControlBackground( GetSettings().GetStyleSettings().GetFaceGradientColor() ); - SetPointFont( rStyleSettings.GetMenuFont() ); SetBackground( Wallpaper( GetControlBackground() ) ); SetTextColor( rStyleSettings.GetMenuTextColor() ); @@ -919,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() ); @@ -927,7 +928,7 @@ void ToolbarMenu::implHighlightEntry( int nHighlightEntry, bool bHighlight ) { bDrawItemRect = false; if( sal_False == DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM, - Region( aItemRect ), + aItemRect, CTRL_STATE_SELECTED | ( pEntry->mbEnabled? CTRL_STATE_ENABLED: 0 ), ImplControlValue(), OUString() ) ) @@ -1311,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() ); } @@ -1334,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), @@ -1350,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 ) ) @@ -1366,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; @@ -1491,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 0652dfb9d0f5..990dfc98f89b 100644 --- a/svtools/source/dialogs/addresstemplate.src +++ b/svtools/source/dialogs/addresstemplate.src @@ -39,6 +39,7 @@ ModalDialog DLG_ADDRESSBOOKSOURCE { + HelpID = "svtools:ModalDialog:DLG_ADDRESSBOOKSOURCE"; SVLook = TRUE ; OutputSize = TRUE ; Size = MAP_APPFONT ( 300 , 88 + FIELD_ROW_HEIGHT * FIELD_PAIRS_VISIBLE ) ; @@ -64,6 +65,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 ) ; @@ -73,6 +75,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 ) ; @@ -90,6 +93,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 7f9896446e3b..73ad8e93e78e 100644 --- a/svtools/source/dialogs/filedlg2.cxx +++ b/svtools/source/dialogs/filedlg2.cxx @@ -68,9 +68,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(); @@ -226,10 +226,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 ); @@ -347,7 +347,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 ); @@ -782,10 +782,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/logindlg.cxx b/svtools/source/dialogs/logindlg.cxx deleted file mode 100644 index c51f7cc1bca0..000000000000 --- a/svtools/source/dialogs/logindlg.cxx +++ /dev/null @@ -1,312 +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 <filedlg.hxx> -#include <vcl/msgbox.hxx> -#include <svtools/logindlg.hxx> - -#ifndef _SVTOOLS_LOGINDLG_HRC_ -#include "logindlg.hrc" -#endif -#ifndef _SVTOOLS_HRC -#include <svtools/svtools.hrc> -#endif -#include <svtools/svtdata.hxx> - -#ifdef UNX -#include <limits.h> -#define _MAX_PATH PATH_MAX -#endif - -// LoginDialog ------------------------------------------------------- - -//............................................................................ -namespace svt -{ -//............................................................................ - -void LoginDialog::HideControls_Impl( sal_uInt16 nFlags ) -{ - int bPathHide = sal_False; - int bErrorHide = sal_False; - int bAccountHide = sal_False; - - if ( ( nFlags & LF_NO_PATH ) == LF_NO_PATH ) - { - aPathFT.Hide(); - aPathED.Hide(); - aPathBtn.Hide(); - bPathHide = sal_True; - } - else if ( ( nFlags & LF_PATH_READONLY ) == LF_PATH_READONLY ) - { - aPathED.Hide(); - aPathInfo.Show(); - aPathBtn.Hide(); - } - - if ( ( nFlags & LF_NO_USERNAME ) == LF_NO_USERNAME ) - { - aNameFT.Hide(); - aNameED.Hide(); - } - else if ( ( nFlags & LF_USERNAME_READONLY ) == LF_USERNAME_READONLY ) - { - aNameED.Hide(); - aNameInfo.Show(); - } - - if ( ( nFlags & LF_NO_PASSWORD ) == LF_NO_PASSWORD ) - { - aPasswordFT.Hide(); - aPasswordED.Hide(); - } - - if ( ( nFlags & LF_NO_SAVEPASSWORD ) == LF_NO_SAVEPASSWORD ) - aSavePasswdBtn.Hide(); - - if ( ( nFlags & LF_NO_ERRORTEXT ) == LF_NO_ERRORTEXT ) - { - aErrorInfo.Hide(); - aErrorGB.Hide(); - bErrorHide = sal_True; - } - - if ( ( nFlags & LF_NO_ACCOUNT ) == LF_NO_ACCOUNT ) - { - aAccountFT.Hide(); - aAccountED.Hide(); - bAccountHide = sal_True; - } - - if ( bErrorHide ) - { - long nOffset = aLoginGB.GetPosPixel().Y() - - aErrorGB.GetPosPixel().Y(); - Point aNewPnt = aRequestInfo.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aRequestInfo.SetPosPixel( aNewPnt ); - aNewPnt = aPathFT.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aPathFT.SetPosPixel( aNewPnt ); - aNewPnt = aPathED.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aPathED.SetPosPixel( aNewPnt ); - aNewPnt = aPathInfo.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aPathInfo.SetPosPixel( aNewPnt ); - aNewPnt = aPathBtn.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aPathBtn.SetPosPixel( aNewPnt ); - aNewPnt = aNameFT.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aNameFT.SetPosPixel( aNewPnt ); - aNewPnt = aNameED.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aNameED.SetPosPixel( aNewPnt ); - aNewPnt = aNameInfo.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aNameInfo.SetPosPixel( aNewPnt ); - aNewPnt = aPasswordFT.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aPasswordFT.SetPosPixel( aNewPnt ); - aNewPnt = aPasswordED.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aPasswordED.SetPosPixel( aNewPnt ); - aNewPnt = aAccountFT.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aAccountFT.SetPosPixel( aNewPnt ); - aNewPnt = aAccountED.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aAccountED.SetPosPixel( aNewPnt ); - aNewPnt = aSavePasswdBtn.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aSavePasswdBtn.SetPosPixel( aNewPnt ); - aNewPnt = aLoginGB.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aLoginGB.SetPosPixel( aNewPnt ); - Size aNewSiz = GetSizePixel(); - aNewSiz.Height() -= nOffset; - SetSizePixel( aNewSiz ); - } - - if ( bPathHide ) - { - long nOffset = aNameED.GetPosPixel().Y() - - aPathED.GetPosPixel().Y(); - - Point aTmpPnt1 = aNameFT.GetPosPixel(); - Point aTmpPnt2 = aPasswordFT.GetPosPixel(); - aNameFT.SetPosPixel( aPathFT.GetPosPixel() ); - aPasswordFT.SetPosPixel( aTmpPnt1 ); - aAccountFT.SetPosPixel( aTmpPnt2 ); - aTmpPnt1 = aNameED.GetPosPixel(); - aTmpPnt2 = aPasswordED.GetPosPixel(); - aNameED.SetPosPixel( aPathED.GetPosPixel() ); - aPasswordED.SetPosPixel( aTmpPnt1 ); - aAccountED.SetPosPixel( aTmpPnt2 ); - aNameInfo.SetPosPixel( aPathInfo.GetPosPixel() ); - aTmpPnt1 = aSavePasswdBtn.GetPosPixel(); - aTmpPnt1.Y() -= nOffset; - aSavePasswdBtn.SetPosPixel( aTmpPnt1 ); - Size aNewSz = GetSizePixel(); - aNewSz.Height() -= nOffset; - SetSizePixel( aNewSz ); - } - - if ( bAccountHide ) - { - long nOffset = aAccountED.GetPosPixel().Y() - aPasswordED.GetPosPixel().Y(); - - Point aTmpPnt = aSavePasswdBtn.GetPosPixel(); - aTmpPnt.Y() -= nOffset; - aSavePasswdBtn.SetPosPixel( aTmpPnt ); - Size aNewSz = GetSizePixel(); - aNewSz.Height() -= nOffset; - SetSizePixel( aNewSz ); - } -}; - -// ----------------------------------------------------------------------- - -IMPL_LINK( LoginDialog, OKHdl_Impl, OKButton *, EMPTYARG ) -{ - // trim the strings - aNameED.SetText( aNameED.GetText().EraseLeadingChars(). - EraseTrailingChars() ); - aPasswordED.SetText( aPasswordED.GetText().EraseLeadingChars(). - EraseTrailingChars() ); - EndDialog( RET_OK ); - return 1; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( LoginDialog, PathHdl_Impl, PushButton *, EMPTYARG ) -{ - PathDialog* pDlg = new PathDialog( this, WB_3DLOOK ); -// DirEntry aEntry; -// aEntry.ToAbs(); -// pDlg->SetPath( aEntry.GetFull() ); - - if ( pDlg->Execute() == RET_OK ) - aPathED.SetText( pDlg->GetPath() ); - - delete pDlg; - return 1; -} - -// ----------------------------------------------------------------------- - -LoginDialog::LoginDialog -( - Window* pParent, - sal_uInt16 nFlags, - const String& rServer, - const String* pRealm -) : - - ModalDialog( pParent, SvtResId( DLG_LOGIN ) ), - - aErrorInfo ( this, SvtResId( INFO_LOGIN_ERROR ) ), - aErrorGB ( this, SvtResId( GB_LOGIN_ERROR ) ), - aRequestInfo ( this, SvtResId( INFO_LOGIN_REQUEST ) ), - aPathFT ( this, SvtResId( FT_LOGIN_PATH ) ), - aPathED ( this, SvtResId( ED_LOGIN_PATH ) ), - aPathInfo ( this, SvtResId( INFO_LOGIN_PATH ) ), - aPathBtn ( this, SvtResId( BTN_LOGIN_PATH ) ), - aNameFT ( this, SvtResId( FT_LOGIN_USERNAME ) ), - aNameED ( this, SvtResId( ED_LOGIN_USERNAME ) ), - aNameInfo ( this, SvtResId( INFO_LOGIN_USERNAME ) ), - aPasswordFT ( this, SvtResId( FT_LOGIN_PASSWORD ) ), - aPasswordED ( this, SvtResId( ED_LOGIN_PASSWORD ) ), - aAccountFT ( this, SvtResId( FT_LOGIN_ACCOUNT ) ), - aAccountED ( this, SvtResId( ED_LOGIN_ACCOUNT ) ), - aSavePasswdBtn ( this, SvtResId( CB_LOGIN_SAVEPASSWORD ) ), - aLoginGB ( this, SvtResId( GB_LOGIN_LOGIN ) ), - aOKBtn ( this, SvtResId( BTN_LOGIN_OK ) ), - aCancelBtn ( this, SvtResId( BTN_LOGIN_CANCEL ) ), - aHelpBtn ( this, SvtResId( BTN_LOGIN_HELP ) ) - -{ - // Einlog-Ort eintragen - String aServer; - - if ( ( ( nFlags & LF_NO_ACCOUNT ) == LF_NO_ACCOUNT ) && pRealm && pRealm->Len() ) - { - aServer = *pRealm; - ( ( aServer += ' ' ) += String( SvtResId( STR_LOGIN_AT ) ) ) += ' '; - } - aServer += rServer; - String aTxt = aRequestInfo.GetText(); - aTxt.SearchAndReplaceAscii( "%1", aServer ); - aRequestInfo.SetText( aTxt ); - - FreeResource(); - - aPathED.SetMaxTextLen( _MAX_PATH ); - aNameED.SetMaxTextLen( _MAX_PATH ); - - aOKBtn.SetClickHdl( LINK( this, LoginDialog, OKHdl_Impl ) ); - aPathBtn.SetClickHdl( LINK( this, LoginDialog, PathHdl_Impl ) ); - - HideControls_Impl( nFlags ); -}; - -// ----------------------------------------------------------------------- - -void LoginDialog::SetName( const String& rNewName ) -{ - aNameED.SetText( rNewName ); - aNameInfo.SetText( rNewName ); -} - -// ----------------------------------------------------------------------- - -void LoginDialog::ClearPassword() -{ - aPasswordED.SetText( String() ); - - if ( 0 == aNameED.GetText().Len() ) - aNameED.GrabFocus(); - else - aPasswordED.GrabFocus(); -}; - -// ----------------------------------------------------------------------- - -void LoginDialog::ClearAccount() -{ - aAccountED.SetText( String() ); - aAccountED.GrabFocus(); -}; - -//............................................................................ -} // namespace svt -//............................................................................ diff --git a/svtools/source/dialogs/logindlg.hrc b/svtools/source/dialogs/logindlg.hrc deleted file mode 100644 index 7baf6010f531..000000000000 --- a/svtools/source/dialogs/logindlg.hrc +++ /dev/null @@ -1,57 +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 _SVTOOLS_LOGINDLG_HRC_ -#define _SVTOOLS_LOGINDLG_HRC_ - -//============================================================================ -#define INFO_LOGIN_ERROR 10 -#define GB_LOGIN_ERROR 11 - -#define INFO_LOGIN_REQUEST 20 -#define FT_LOGIN_PATH 21 -#define ED_LOGIN_PATH 22 -#define INFO_LOGIN_PATH 23 -#define BTN_LOGIN_PATH 24 -#define FT_LOGIN_USERNAME 25 -#define ED_LOGIN_USERNAME 26 -#define INFO_LOGIN_USERNAME 27 -#define FT_LOGIN_PASSWORD 28 -#define ED_LOGIN_PASSWORD 29 -#define FT_LOGIN_ACCOUNT 30 -#define ED_LOGIN_ACCOUNT 31 -#define CB_LOGIN_SAVEPASSWORD 32 -#define GB_LOGIN_LOGIN 33 - -#define BTN_LOGIN_OK 50 -#define BTN_LOGIN_CANCEL 51 -#define BTN_LOGIN_HELP 52 - -#define STR_LOGIN_AT 60 - -#endif // _SVTOOLS_LOGINDLG_HRC_ diff --git a/svtools/source/dialogs/logindlg.src b/svtools/source/dialogs/logindlg.src deleted file mode 100644 index f6e3565d8cd9..000000000000 --- a/svtools/source/dialogs/logindlg.src +++ /dev/null @@ -1,200 +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 _SVTOOLS_HRC -#include <svtools/svtools.hrc> -#endif - -#ifndef _SVTOOLS_LOGINDLG_HRC_ -#include "logindlg.hrc" -#endif - -ModalDialog DLG_LOGIN -{ -// HelpId = HID_DLG_LOGIN ; - Border = TRUE ; - Moveable = TRUE ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 265 , 158 ) ; - FixedText INFO_LOGIN_ERROR - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 185 , 18 ) ; - WordBreak = TRUE ; - }; - FixedLine GB_LOGIN_ERROR - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 197 , 8 ) ; - Text [ en-US ] = "Message from server" ; - }; - FixedText INFO_LOGIN_REQUEST - { - Pos = MAP_APPFONT ( 12 , 55 ) ; - Size = MAP_APPFONT ( 185 , 18 ) ; - WordBreak = TRUE ; - Text [ en-US ] = "Please enter user name and password for %1." ; - }; - FixedText FT_LOGIN_PATH - { - Pos = MAP_APPFONT ( 12 , 77 ) ; - Size = MAP_APPFONT ( 57 , 10 ) ; - Text [ en-US ] = "~Path" ; - }; - Edit ED_LOGIN_PATH - { - Border = TRUE ; - Pos = MAP_APPFONT ( 72 , 76 ) ; - Size = MAP_APPFONT ( 108 , 12 ) ; - }; - FixedText INFO_LOGIN_PATH - { - Hide = TRUE ; - Pos = MAP_APPFONT ( 72 , 77 ) ; - Size = MAP_APPFONT ( 125 , 10 ) ; - }; - PushButton BTN_LOGIN_PATH - { - Pos = MAP_APPFONT ( 183 , 75 ) ; - Size = MAP_APPFONT ( 14 , 14 ) ; - Text = "~..." ; - }; - FixedText FT_LOGIN_USERNAME - { - Pos = MAP_APPFONT ( 12 , 92 ) ; - Size = MAP_APPFONT ( 57 , 10 ) ; - Text [ en-US ] = "~User name" ; - }; - Edit ED_LOGIN_USERNAME - { - Border = TRUE ; - Pos = MAP_APPFONT ( 72 , 91 ) ; - Size = MAP_APPFONT ( 125 , 12 ) ; - }; - FixedText INFO_LOGIN_USERNAME - { - Hide = TRUE ; - Pos = MAP_APPFONT ( 72 , 92 ) ; - Size = MAP_APPFONT ( 125 , 10 ) ; - }; - FixedText FT_LOGIN_PASSWORD - { - Pos = MAP_APPFONT ( 12 , 107 ) ; - Size = MAP_APPFONT ( 57 , 10 ) ; - Text [ en-US ] = "Pass~word" ; - }; - Edit ED_LOGIN_PASSWORD - { - Border = TRUE ; - Pos = MAP_APPFONT ( 72 , 106 ) ; - Size = MAP_APPFONT ( 125 , 12 ) ; - PassWord = TRUE ; - }; - FixedText FT_LOGIN_ACCOUNT - { - Pos = MAP_APPFONT ( 12 , 122 ) ; - Size = MAP_APPFONT ( 57 , 10 ) ; - Text [ en-US ] = "A~ccount"; - }; - Edit ED_LOGIN_ACCOUNT - { - Border = TRUE ; - Pos = MAP_APPFONT ( 72 , 121 ) ; - Size = MAP_APPFONT ( 125 , 12 ) ; - PassWord = TRUE ; - }; - CheckBox CB_LOGIN_SAVEPASSWORD - { - Pos = MAP_APPFONT ( 12 , 136 ) ; - Size = MAP_APPFONT ( 185 , 10 ) ; - Text [ en-US ] = "~Save password" ; - }; - FixedLine GB_LOGIN_LOGIN - { - Pos = MAP_APPFONT ( 7 , 44 ) ; - Size = MAP_APPFONT ( 197 , 8 ) ; - Text [ en-US ] = "Log in" ; - }; - OKButton BTN_LOGIN_OK - { - Pos = MAP_APPFONT ( 209 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - DefButton = TRUE ; - }; - CancelButton BTN_LOGIN_CANCEL - { - Pos = MAP_APPFONT ( 209 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - }; - HelpButton BTN_LOGIN_HELP - { - Pos = MAP_APPFONT ( 209 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - }; - String STR_LOGIN_AT - { - Text [ en-US ] = "to " ; - }; - Text [ en-US ] = "User Name and Password Required" ; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/svtools/source/dialogs/makefile.mk b/svtools/source/dialogs/makefile.mk index 16528ee7d4cd..99c4b59b76ae 100644 --- a/svtools/source/dialogs/makefile.mk +++ b/svtools/source/dialogs/makefile.mk @@ -44,7 +44,6 @@ SRC1FILES= filedlg2.src \ prnsetup.src \ printdlg.src \ colrdlg.src \ - logindlg.src \ addresstemplate.src \ wizardmachine.src @@ -69,8 +68,7 @@ SLOFILES= \ $(SLO)$/colrdlg.obj \ $(SLO)$/property.obj \ $(SLO)$/wizdlg.obj \ - $(SLO)$/mcvmath.obj \ - $(SLO)$/logindlg.obj + $(SLO)$/mcvmath.obj # --- Targets ------------------------------------------------------ diff --git a/svtools/source/dialogs/printdlg.cxx b/svtools/source/dialogs/printdlg.cxx index 8ac47db14cdd..dc726683a355 100644 --- a/svtools/source/dialogs/printdlg.cxx +++ b/svtools/source/dialogs/printdlg.cxx @@ -28,26 +28,18 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svtools.hxx" #include <tools/debug.hxx> -#ifndef _SV_APP_HXX #include <vcl/svapp.hxx> -#endif -#ifndef _VCL_PRINT_HXX #include <vcl/print.hxx> -#endif #include <vcl/msgbox.hxx> #include <vcl/jobset.hxx> #include <tools/urlobj.hxx> - #include "printdlg.hrc" #include "controldims.hrc" #include <svtools/prnsetup.hxx> #include <svtools/printdlg.hxx> #include <svtools/svtdata.hxx> #include <filedlg.hxx> -#include "svl/pickerhelper.hxx" -#ifndef _SVT_HELPID_HRC #include <svtools/helpid.hrc> -#endif #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp> #include <com/sun/star/ui/dialogs/XFilePicker.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 c28cfe1d4b18..43b9fcddf91d 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/edit/editsyntaxhighlighter.cxx b/svtools/source/edit/editsyntaxhighlighter.cxx index 53d83075453a..65e3f58dbae6 100644 --- a/svtools/source/edit/editsyntaxhighlighter.cxx +++ b/svtools/source/edit/editsyntaxhighlighter.cxx @@ -193,7 +193,7 @@ void MultiLineEditSyntaxHighlight::UpdateData() GetTextEngine()->RemoveAttribs( nLine, sal_True ); HighlightPortions aPortions; aHighlighter.getHighlightPortions( nLine, aLine, aPortions ); - for ( sal_uInt16 i = 0; i < aPortions.Count(); i++ ) + for ( size_t i = 0; i < aPortions.size(); i++ ) { HighlightPortion& r = aPortions[i]; GetTextEngine()->SetAttrib( TextAttribFontColor( GetColorValue(r.tokenType) ), nLine, r.nBegin, r.nEnd, sal_True ); diff --git a/svtools/source/edit/makefile.mk b/svtools/source/edit/makefile.mk index 58a63be58f78..8d4da553cb0d 100644 --- a/svtools/source/edit/makefile.mk +++ b/svtools/source/edit/makefile.mk @@ -38,25 +38,23 @@ TARGET=edit # --- Files -------------------------------------------------------- SLOFILES= \ + $(EXCEPTIONSFILES) \ $(SLO)$/textdata.obj \ - $(SLO)$/textdoc.obj \ - $(SLO)$/texteng.obj \ $(SLO)$/textundo.obj \ - $(SLO)$/textview.obj \ $(SLO)$/txtattr.obj \ $(SLO)$/xtextedt.obj \ $(SLO)$/sychconv.obj \ $(SLO)$/svmedit.obj \ $(SLO)$/svmedit2.obj \ - $(SLO)$/textwindowpeer.obj \ - $(SLO)$/syntaxhighlight.obj \ $(SLO)$/editsyntaxhighlighter.obj EXCEPTIONSFILES= \ $(SLO)$/textview.obj \ $(SLO)$/textdoc.obj \ $(SLO)$/texteng.obj \ - $(SLO)$/textwindowpeer.obj + $(SLO)$/textwindowpeer.obj \ + $(SLO)$/syntaxhighlight.obj \ + # --- Targets ------------------------------------------------------ diff --git a/svtools/source/edit/syntaxhighlight.cxx b/svtools/source/edit/syntaxhighlight.cxx index 8343ce3a0121..9e4e7d391125 100644 --- a/svtools/source/edit/syntaxhighlight.cxx +++ b/svtools/source/edit/syntaxhighlight.cxx @@ -34,9 +34,6 @@ #include <tools/debug.hxx> -SV_IMPL_VARARR(HighlightPortions, HighlightPortion) - - // ########################################################################## // ATTENTION: all these words needs to be in small caps // ########################################################################## @@ -849,7 +846,7 @@ void SimpleTokenizer_Impl::getHighlightPortions( sal_uInt32 nParseLine, const St portion.nEnd = (sal_uInt16)(pEndPos - mpStringBegin); portion.tokenType = eType; - portions.Insert(portion, portions.Count()); + portions.push_back(portion); } } diff --git a/svtools/source/edit/textdata.cxx b/svtools/source/edit/textdata.cxx index 1f3f62d20e9d..e311688d97d4 100644 --- a/svtools/source/edit/textdata.cxx +++ b/svtools/source/edit/textdata.cxx @@ -37,7 +37,7 @@ SV_IMPL_PTRARR( TextLines, TextLinePtr ); SV_IMPL_VARARR( TEWritingDirectionInfos, TEWritingDirectionInfo ); -// ------------------------------------------------------------------------- +// ------------------------------------------------------------------------- // (+) class TextSelection // ------------------------------------------------------------------------- @@ -66,7 +66,7 @@ void TextSelection::Justify() } -// ------------------------------------------------------------------------- +// ------------------------------------------------------------------------- // (+) class TETextPortionList // ------------------------------------------------------------------------- TETextPortionList::TETextPortionList() @@ -129,7 +129,7 @@ sal_uInt16 TETextPortionList::GetPortionStartIndex( sal_uInt16 nPortion ) */ -// ------------------------------------------------------------------------- +// ------------------------------------------------------------------------- // (+) class TEParaPortion // ------------------------------------------------------------------------- TEParaPortion::TEParaPortion( TextNode* pN ) @@ -254,7 +254,7 @@ void TEParaPortion::CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormat } } -// ------------------------------------------------------------------------- +// ------------------------------------------------------------------------- // (+) class TEParaPortions // ------------------------------------------------------------------------- TEParaPortions::TEParaPortions() @@ -274,7 +274,7 @@ void TEParaPortions::Reset() clear(); } -// ------------------------------------------------------------------------- +// ------------------------------------------------------------------------- // (+) class IdleFormatter // ------------------------------------------------------------------------- IdleFormatter::IdleFormatter() 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 cf6d735c7258..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( sal_True ); - ClickRbSize( NULL ); - } - break; - case 1 : - { - aRbRes.Check( sal_True ); - ClickRbRes( NULL ); - } - break; - default : - { - aRbOriginal.Check( sal_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 sal_uInt16 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( sal_True ); - ClickRbSize( NULL ); - } - break; - - default : - { - aRbOriginal.Check( sal_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..701619d31f6c --- /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< sal_uInt16 >( 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< sal_uInt16 >( 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 51658847c55f..8002629c22e7 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" @@ -552,16 +552,48 @@ static sal_Bool ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtensio if( !bTest || ( rFormatExtension.CompareToAscii( "PCT", 3 ) == COMPARE_EQUAL ) ) { bSomethingTested = sal_True; - sal_uInt8 sBuf[4]; + sal_uInt8 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 sal_True; + rFormatExtension = UniString::CreateFromAscii( "PCT", 3 ); + return sal_True; + } + // normal version 1 - page A25 + else if (sBuf[ 0 ] == 0x11 && sBuf[ 1 ] == 0x01 && bdBoxOk) { + rFormatExtension = UniString::CreateFromAscii( "PCT", 3 ); + return sal_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 sal_True; } } } @@ -752,7 +784,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 @@ -782,7 +814,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 ); @@ -806,7 +838,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() ); @@ -1771,7 +1803,7 @@ sal_uInt16 GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& 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 03806b9b3c03..39e83dfbfe5e 100644 --- a/svtools/source/filter.vcl/filter/filter2.cxx +++ b/svtools/source/filter.vcl/filter/filter2.cxx @@ -42,29 +42,6 @@ sal_uInt8* ImplSearchEntry( sal_uInt8* , sal_uInt8* , sal_uIntPtr , sal_uIntPtr ); - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -GraphicDescriptor::GraphicDescriptor( const String* pPath ) : - pFileStm ( NULL ) -{ - ImpConstruct(); - - if ( pPath ) - { - INetURLObject aURL( *pPath, INET_PROT_FILE ); - aPathExt = aURL.GetFileExtension().toAsciiLowerCase(); - } - bLinked = sal_True; - bLinkChanged = sal_False; - bWideSearch = sal_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( sal_True ) { - if ( pFileStm ) - { - nStmPos = 0; - pFileStm->Seek( nStmPos ); - bDataReady = sal_True; - } - ImpConstruct(); - - if ( pFileStm && !pFileStm->GetError() ) - bDataReady = sal_True; } /************************************************************************* @@ -95,7 +63,8 @@ GraphicDescriptor::GraphicDescriptor( const INetURLObject& rPath ) : \************************************************************************/ GraphicDescriptor::GraphicDescriptor( SvStream& rInStream, const String* pPath) : - pFileStm ( NULL ) + pFileStm ( &rInStream ), + bOwnStream ( sal_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 = sal_True; - - if ( !pBaseStm->GetError() ) - bDataReady = sal_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() sal_Bool GraphicDescriptor::Detect( sal_Bool bExtendedInfo ) { sal_Bool bRet = sal_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 = sal_True; - } - } - - if ( bDataReady ) + if ( pFileStm && !pFileStm->GetError() ) { - SvStream& rStm = GetSearchStream(); + SvStream& rStm = *pFileStm; sal_uInt16 nOldFormat = rStm.GetNumberFormatInt(); if ( ImpDetectGIF( rStm, bExtendedInfo ) ) bRet = sal_True; @@ -175,96 +124,13 @@ sal_Bool GraphicDescriptor::Detect( sal_Bool bExtendedInfo ) else if ( ImpDetectTGA( rStm, bExtendedInfo ) ) bRet = sal_True; else if ( ImpDetectPSD( rStm, bExtendedInfo ) ) bRet = sal_True; else if ( ImpDetectEPS( rStm, bExtendedInfo ) ) bRet = sal_True; - - // diese Formate lassen sich nur bei WideSearch im gesamten - // Stream ermitteln - else if ( bWideSearch ) - { - if ( ImpDetectPCD( rStm, bExtendedInfo ) ) - bRet = sal_True; - } + else if ( ImpDetectPCD( rStm, bExtendedInfo ) ) bRet = sal_True; rStm.SetNumberFormatInt( nOldFormat ); - rStm.Seek( nStmPos ); } - return bRet; } - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -sal_Bool GraphicDescriptor::IsDataReady() const -{ - return bDataReady; -} - - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -sal_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 = sal_True; -} - - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -sal_uIntPtr GraphicDescriptor::GetRequestedByteCount() const -{ - return DATA_SIZE; -} - - -/******************************************************************************/ -/* IMP-Methoden */ -/* */ - - /************************************************************************* |* |* @@ -273,17 +139,10 @@ sal_uIntPtr GraphicDescriptor::GetRequestedByteCount() const void GraphicDescriptor::ImpConstruct() { - if ( !pFileStm ) - pFileStm = new SvStream(); nFormat = GFF_NOT; nBitsPerPixel = 0; nPlanes = 0; bCompressed = sal_False; - bDataReady = sal_False; - bLinked = sal_False; - bWideSearch = sal_True; - bBaseStm = sal_False; - pMemStm = NULL; } @@ -297,10 +156,9 @@ sal_Bool GraphicDescriptor::ImpDetectBMP( SvStream& rStm, sal_Bool bExtendedInfo { sal_uInt16 nTemp16; sal_Bool bRet = sal_False; + sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); - rStm.Seek( nStmPos ); - rStm >> nTemp16; // OS/2-BitmapArray @@ -364,7 +222,7 @@ sal_Bool GraphicDescriptor::ImpDetectBMP( SvStream& rStm, sal_Bool bExtendedInfo } } } - + rStm.Seek( nStmPos ); return bRet; } @@ -382,10 +240,10 @@ sal_Bool GraphicDescriptor::ImpDetectGIF( SvStream& rStm, sal_Bool bExtendedInfo sal_Bool bRet = sal_False; sal_uInt8 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 @@ sal_Bool GraphicDescriptor::ImpDetectGIF( SvStream& rStm, sal_Bool bExtendedInfo } } } - + rStm.Seek( nStmPos ); return bRet; } @@ -423,125 +281,188 @@ sal_Bool GraphicDescriptor::ImpDetectGIF( SvStream& rStm, sal_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; +} + sal_Bool GraphicDescriptor::ImpDetectJPG( SvStream& rStm, sal_Bool bExtendedInfo ) { sal_uInt32 nTemp32; sal_Bool bRet = sal_False; - sal_uInt8 cByte = 0; - sal_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 sal_True; - } - - bM_COM = ( nTemp32 == 0xffd8fffe ); - if ( ( nTemp32 == 0xffd8ffe0 ) || bM_COM ) - { - if( !bM_COM ) - { - rStm.SeekRel( 2 ); - rStm >> nTemp32; - } + bRet = sal_True; - if( bM_COM || ( nTemp32 == 0x4a464946 ) ) + if ( bExtendedInfo ) { - nFormat = GFF_JPG; - bRet = sal_True; + rStm.SeekRel( -2 ); - if( bExtendedInfo ) - { - MapMode aMap; - sal_uInt16 nTemp16; - sal_uIntPtr nCount = 9; - sal_uIntPtr nMax; - sal_uIntPtr nResX; - sal_uIntPtr nResY; - sal_uInt8 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, (sal_uIntPtr) 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 @@ sal_Bool GraphicDescriptor::ImpDetectPCD( SvStream& rStm, sal_Bool ) { sal_Bool bRet = sal_False; + sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); - rStm.Seek( nStmPos ); - if ( bWideSearch ) - { - sal_uInt32 nTemp32; - sal_uInt16 nTemp16; - sal_uInt8 cByte; + sal_uInt32 nTemp32; + sal_uInt16 nTemp16; + sal_uInt8 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 = sal_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 = sal_True; } - + rStm.Seek( nStmPos ); return bRet; } @@ -608,10 +518,10 @@ sal_Bool GraphicDescriptor::ImpDetectPCX( SvStream& rStm, sal_Bool bExtendedInfo sal_Bool bRet = sal_False; sal_uInt8 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 @@ sal_Bool GraphicDescriptor::ImpDetectPCX( SvStream& rStm, sal_Bool bExtendedInfo } } + rStm.Seek( nStmPos ); return bRet; } @@ -690,10 +601,10 @@ sal_Bool GraphicDescriptor::ImpDetectPNG( SvStream& rStm, sal_Bool bExtendedInfo sal_uInt32 nTemp32; sal_Bool bRet = sal_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 @@ sal_Bool GraphicDescriptor::ImpDetectPNG( SvStream& rStm, sal_Bool bExtendedInfo nPlanes = 1; bCompressed = sal_True; - if ( bWideSearch ) - { - sal_uInt32 nLen32; + sal_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 ) - { - sal_uIntPtr nXRes; - sal_uIntPtr nYRes; + if ( nTemp32 == 0x70485973 ) + { + sal_uIntPtr nXRes; + sal_uIntPtr 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 @@ sal_Bool GraphicDescriptor::ImpDetectTIF( SvStream& rStm, sal_Bool bExtendedInfo sal_uInt8 cByte1; sal_uInt8 cByte2; - rStm.Seek( nStmPos ); + sal_Int32 nStmPos = rStm.Tell(); rStm >> cByte1; rStm >> cByte2; if ( cByte1 == cByte2 ) @@ -829,14 +737,14 @@ sal_Bool GraphicDescriptor::ImpDetectTIF( SvStream& rStm, sal_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 @@ sal_Bool GraphicDescriptor::ImpDetectTIF( SvStream& rStm, sal_Bool bExtendedInfo } } } - + rStm.Seek( nStmPos ); return bRet; } @@ -965,11 +873,12 @@ sal_Bool GraphicDescriptor::ImpDetectPBM( SvStream& rStm, sal_Bool ) bRet = sal_True; else { + sal_Int32 nStmPos = rStm.Tell(); sal_uInt8 nFirst, nSecond; - rStm.Seek( nStmPos ); rStm >> nFirst >> nSecond; if ( nFirst == 'P' && ( ( nSecond == '1' ) || ( nSecond == '4' ) ) ) bRet = sal_True; + rStm.Seek( nStmPos ); } if ( bRet ) @@ -992,11 +901,12 @@ sal_Bool GraphicDescriptor::ImpDetectPGM( SvStream& rStm, sal_Bool ) bRet = sal_True; else { - sal_uInt8 nFirst, nSecond; - rStm.Seek( nStmPos ); + sal_uInt8 nFirst, nSecond; + sal_Int32 nStmPos = rStm.Tell(); rStm >> nFirst >> nSecond; if ( nFirst == 'P' && ( ( nSecond == '2' ) || ( nSecond == '5' ) ) ) bRet = sal_True; + rStm.Seek( nStmPos ); } if ( bRet ) @@ -1020,10 +930,11 @@ sal_Bool GraphicDescriptor::ImpDetectPPM( SvStream& rStm, sal_Bool ) else { sal_uInt8 nFirst, nSecond; - rStm.Seek( nStmPos ); + sal_Int32 nStmPos = rStm.Tell(); rStm >> nFirst >> nSecond; if ( nFirst == 'P' && ( ( nSecond == '3' ) || ( nSecond == '6' ) ) ) bRet = sal_True; + rStm.Seek( nStmPos ); } if ( bRet ) @@ -1041,16 +952,17 @@ sal_Bool GraphicDescriptor::ImpDetectPPM( SvStream& rStm, sal_Bool ) sal_Bool GraphicDescriptor::ImpDetectRAS( SvStream& rStm, sal_Bool ) { sal_uInt32 nMagicNumber; - rStm.Seek( nStmPos ); + sal_Bool bRet = sal_False; + sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); rStm >> nMagicNumber; if ( nMagicNumber == 0x59a66a95 ) { nFormat = GFF_RAS; - return sal_True; + bRet = sal_True; } - else - return sal_False; + rStm.Seek( nStmPos ); + return bRet; } /************************************************************************* @@ -1079,7 +991,7 @@ sal_Bool GraphicDescriptor::ImpDetectPSD( SvStream& rStm, sal_Bool bExtendedInfo sal_Bool bRet = sal_False; sal_uInt32 nMagicNumber; - rStm.Seek( nStmPos ); + sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); rStm >> nMagicNumber; if ( nMagicNumber == 0x38425053 ) @@ -1123,6 +1035,7 @@ sal_Bool GraphicDescriptor::ImpDetectPSD( SvStream& rStm, sal_Bool bExtendedInfo if ( bRet ) nFormat = GFF_PSD; + rStm.Seek( nStmPos ); return bRet; } @@ -1139,8 +1052,9 @@ sal_Bool GraphicDescriptor::ImpDetectEPS( SvStream& rStm, sal_Bool ) sal_uInt32 nFirstLong; sal_uInt8 nFirstBytes[20]; + sal_Bool bRet = sal_False; - rStm.Seek( nStmPos ); + sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); rStm >> nFirstLong; rStm.SeekRel( -4 ); @@ -1151,10 +1065,10 @@ sal_Bool GraphicDescriptor::ImpDetectEPS( SvStream& rStm, sal_Bool ) && ImplSearchEntry( &nFirstBytes[15], (sal_uInt8*)"EPS", 3, 3 ) ) ) { nFormat = GFF_EPS; - return sal_True; + bRet = sal_True; } - else - return sal_False; + rStm.Seek( nStmPos ); + return bRet; } /************************************************************************* @@ -1201,9 +1115,11 @@ sal_Bool GraphicDescriptor::ImpDetectPCT( SvStream& rStm, sal_Bool ) nFormat = GFF_PCT; else { + sal_Int32 nStmPos = rStm.Tell(); + sal_uInt8 sBuf[4]; - rStm.Seek( nStmPos + 522 ); + rStm.SeekRel( 522 ); rStm.Read( sBuf, 3 ); if( !rStm.GetError() ) @@ -1215,6 +1131,7 @@ sal_Bool GraphicDescriptor::ImpDetectPCT( SvStream& rStm, sal_Bool ) nFormat = GFF_PCT; } } + rStm.Seek( nStmPos ); } return bRet; @@ -1230,18 +1147,20 @@ sal_Bool GraphicDescriptor::ImpDetectPCT( SvStream& rStm, sal_Bool ) sal_Bool GraphicDescriptor::ImpDetectSGF( SvStream& rStm, sal_Bool ) { sal_Bool bRet = sal_False; - if( aPathExt.CompareToAscii( "sgf", 3 ) == COMPARE_EQUAL ) bRet = sal_True; else { + sal_Int32 nStmPos = rStm.Tell(); + sal_uInt8 nFirst, nSecond; - rStm.Seek( nStmPos ); rStm >> nFirst >> nSecond; if( nFirst == 'J' && nSecond == 'J' ) bRet = sal_True; + + rStm.Seek( nStmPos ); } if( bRet ) @@ -1279,9 +1198,8 @@ sal_Bool GraphicDescriptor::ImpDetectSVM( SvStream& rStm, sal_Bool bExtendedInfo sal_Bool bRet = sal_False; sal_uInt8 cByte; + sal_Int32 nStmPos = rStm.Tell(); rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); - rStm.Seek( nStmPos ); - rStm >> n32; if ( n32 == 0x44475653 ) { @@ -1342,7 +1260,7 @@ sal_Bool GraphicDescriptor::ImpDetectSVM( SvStream& rStm, sal_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/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 e2fff4f49433..e8bc8dacce5b 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 4c69d48438a3..561392973011 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 aefc8601ec87..ba3a37199815 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 b93e4287d17c..76afd92829fe 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 @@ sal_uInt16 SetTextContext(OutputDevice& rOut, ObjTextType& Atr, sal_Bool Kapt, s 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 @@ sal_uInt16 SetTextContext(OutputDevice& rOut, ObjTextType& Atr, sal_Bool Kapt, s 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 @@ sal_uInt16 SetTextContext(OutputDevice& rOut, ObjTextType& Atr, sal_Bool Kapt, s 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 3d6b8cf234d0..0abeaa608c6f 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 sal_uInt8; -#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 bfc4437a77e8..feff21933ab6 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, sal_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 a8ffffe4084f..ae5b7c41dc85 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 ); - sal_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 c4420b6b35e4..5645f7ee9ddf 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 73e5718df147..1b236a1e4bee 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 0118047d591e..03924074cfa6 100644 --- a/svtools/source/misc/ehdl.cxx +++ b/svtools/source/misc/ehdl.cxx @@ -64,7 +64,7 @@ static sal_uInt16 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 @@ sal_Bool SfxErrorHandler::GetErrorString( */ { - NAMESPACE_VOS( OGuard ) aGuard( Application::GetSolarMutex() ); + vos:: OGuard aGuard( Application::GetSolarMutex() ); sal_Bool bRet = sal_False; rStr=String(SvtResId(RID_ERRHDL_CLASS)); @@ -454,7 +454,7 @@ sal_Bool SfxErrorContext::GetString(sal_uIntPtr 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/errtxt.src b/svtools/source/misc/errtxt.src index 6c1a90ae6412..f33896e20003 100644 --- a/svtools/source/misc/errtxt.src +++ b/svtools/source/misc/errtxt.src @@ -328,23 +328,23 @@ Resource RID_ERRHDL }; String ERRCODE_INET_CONNECT { - Text [ en-US ] = "Could not establish Internet connection to $(ARG1)." ; + Text [ en-US ] = "Could not establish network connection to $(ARG1)." ; }; String ERRCODE_INET_READ { - Text [ en-US ] = "Error reading data from the Internet.\nServer error message: $(ARG1)." ; + Text [ en-US ] = "Error reading data from the network.\nServer error message: $(ARG1)." ; }; String ERRCODE_INET_WRITE { - Text [ en-US ] = "Error transferring data to the Internet.\nServer error message: $(ARG1)." ; + Text [ en-US ] = "Error transferring data to the network.\nServer error message: $(ARG1)." ; }; String ERRCODE_INET_GENERAL { - Text [ en-US ] = "General Internet error has occurred." ; + Text [ en-US ] = "General network error has occurred." ; }; String ERRCODE_INET_OFFLINE { - Text [ en-US ] = "The requested Internet data is not available in the cache and cannot be transmitted as the Online mode has not be activated." ; + Text [ en-US ] = "The requested network data is not available in the cache and cannot be transmitted as the Online mode has not be activated." ; }; String ERRCODE_SFXMSG_STYLEREPLACE { diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx index 0704b6a0da22..bf81b59530a0 100644 --- a/svtools/source/misc/imap.cxx +++ b/svtools/source/misc/imap.cxx @@ -57,10 +57,6 @@ sal_uInt16 IMapObject::nActualTextEncoding = (sal_uInt16) RTL_TEXTENCODING_DONTK /******************************************************************************/ -#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 92dc43152ed1..c13d8104d878 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/langtab.src b/svtools/source/misc/langtab.src index 1cb20d27fc12..067eb601a5af 100644 --- a/svtools/source/misc/langtab.src +++ b/svtools/source/misc/langtab.src @@ -319,6 +319,10 @@ StringArray STR_ARR_SVT_LANGUAGE_TABLE < "Sardinian, Logudorese" ; LANGUAGE_USER_SARDINIAN_LOGUDORESE ; > ; < "Sardinian, Sassarese" ; LANGUAGE_USER_SARDINIAN_SASSARESE ; > ; < "Bafia" ; LANGUAGE_USER_BAFIA ; > ; + < "Gikuyu" ; LANGUAGE_USER_GIKUYU ; > ; + < "Yoruba" ; LANGUAGE_YORUBA ; > ; + < "Rusyn (Ukraine)" ; LANGUAGE_USER_RUSYN_UKRAINE ; > ; + < "Rusyn (Slovakia)" ; LANGUAGE_USER_RUSYN_SLOVAKIA ; > ; }; }; diff --git a/svtools/source/misc/makefile.mk b/svtools/source/misc/makefile.mk index 65e43747a586..32781dbfefb1 100644 --- a/svtools/source/misc/makefile.mk +++ b/svtools/source/misc/makefile.mk @@ -75,7 +75,8 @@ SLOFILES=\ $(SLO)$/transfer.obj \ $(SLO)$/transfer2.obj \ $(SLO)$/unitconv.obj \ - $(SLO)$/wallitem.obj + $(SLO)$/wallitem.obj \ + $(SLO)$/xwindowitem.obj # --- Targets ------------------------------------------------------- diff --git a/svtools/source/misc/svtdata.cxx b/svtools/source/misc/svtdata.cxx index a162dd16dc7f..7a04b3276c9f 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( sal_uInt16 nId ) : - ResId( nId, *ImpSvtData::GetSvtData().GetPatchResMgr() ) -{ -} - //============================================================================ // static ImpSvtData & ImpSvtData::GetSvtData() diff --git a/svtools/source/contnr/ctrdll.cxx b/svtools/source/misc/xwindowitem.cxx index ee5e97003271..3f499dca0a96 100644 --- a/svtools/source/contnr/ctrdll.cxx +++ b/svtools/source/misc/xwindowitem.cxx @@ -28,52 +28,70 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svtools.hxx" -#ifdef WIN -#include <svwin.h> +#include "svtools/xwindowitem.hxx" -#ifndef _SYSDEP_HXX -#include <sysdep.hxx> -#endif +#include <vcl/window.hxx> -// Statische DLL-Verwaltungs-Variablen -static HINSTANCE hDLLInst = 0; // HANDLE der DLL +using namespace ::com::sun::star; -/*************************************************************************** -|* -|* 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 ) +TYPEINIT1_FACTORY( XWindowItem, SfxPoolItem, new XWindowItem ); + + +XWindowItem::XWindowItem() : + SfxPoolItem() { -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif +} - hDLLInst = hDLL; - return sal_True; +XWindowItem::XWindowItem( sal_uInt16 nWhichId, Window * pWin ) : + SfxPoolItem( nWhichId ) +{ + if (pWin) + { + m_xWin = uno::Reference< awt::XWindow >( pWin->GetComponentInterface(), uno::UNO_QUERY ); + // the assertion can't possibly fails since VCLXWindow implements XWindow... + DBG_ASSERT( m_xWin.is(), "failed to get XWindow" ); + } } -/*************************************************************************** -|* -|* WEP() -|* -|* Beschreibung DLL-Deinitialisierung -|* Ersterstellung TH 05.05.93 -|* Letzte Aenderung TH 05.05.93 -|* -***************************************************************************/ - -extern "C" int CALLBACK WEP( int ) + +XWindowItem::XWindowItem( sal_uInt16 nWhichId, uno::Reference< awt::XWindow > & rxWin ) : + SfxPoolItem( nWhichId ), + m_xWin( rxWin ) +{ +} + + +XWindowItem::XWindowItem( const XWindowItem &rItem ) : + SfxPoolItem( Which() ), + m_xWin( rItem.m_xWin ) +{ +} + + +XWindowItem::~XWindowItem() { - return 1; } -#endif + +SfxPoolItem * XWindowItem::Clone( SfxItemPool* /*pPool*/ ) const +{ + return new XWindowItem( *this ); +} + + +int XWindowItem::operator == ( const SfxPoolItem & rAttr ) const +{ + DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); + + const XWindowItem * pItem = dynamic_cast< const XWindowItem * >(&rAttr); + return pItem ? m_xWin == pItem->m_xWin : 0; +} + + +////////////////////////////////////////////////////////////////////// + + 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/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx index b9b928f26e46..6bf22785e112 100644 --- a/svtools/source/svhtml/parhtml.cxx +++ b/svtools/source/svhtml/parhtml.cxx @@ -2118,11 +2118,7 @@ enum eHtmlMetas { }; // <META NAME=xxx> -#ifdef __MINGW32__ // for runtime pseudo reloc -static HTMLOptionEnum aHTMLMetaNameTable[] = -#else static HTMLOptionEnum __READONLY_DATA aHTMLMetaNameTable[] = -#endif { { OOO_STRING_SVTOOLS_HTML_META_author, HTML_META_AUTHOR }, { OOO_STRING_SVTOOLS_HTML_META_changed, HTML_META_CHANGED }, diff --git a/svtools/source/svrtf/makefile.mk b/svtools/source/svrtf/makefile.mk index 5ebb0e28c69e..cb76882f5f94 100644 --- a/svtools/source/svrtf/makefile.mk +++ b/svtools/source/svrtf/makefile.mk @@ -30,6 +30,8 @@ PRJ=..$/.. PRJNAME=svtools TARGET=svrtf +ENABLE_EXCEPTIONS=TRUE + # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx index 3091919d6623..478846b57b98 100644 --- a/svtools/source/svrtf/parrtf.cxx +++ b/svtools/source/svrtf/parrtf.cxx @@ -44,8 +44,6 @@ const int MAX_TOKEN_LEN = 128; #define RTF_ISDIGIT( c ) (c >= '0' && c <= '9') #define RTF_ISALPHA( c ) ( (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') ) -SV_IMPL_VARARR( RtfParserStates_Impl, RtfParserState_Impl ) - SvRTFParser::SvRTFParser( SvStream& rIn, sal_uInt8 nStackSize ) : SvParser( rIn, nStackSize ), eUNICodeSet( RTL_TEXTENCODING_MS_1252 ), // default ist ANSI-CodeSet @@ -175,14 +173,13 @@ int SvRTFParser::_GetNextToken() nUCharOverread = (sal_uInt8)nTokenValue; #if 1 //cmc: other ifdef breaks #i3584 - aParserStates[ aParserStates.Count()-1]. + aParserStates.top(). nUCharOverread = nUCharOverread; #else if( !nUCharOverread ) - nUCharOverread = aParserStates[ - aParserStates.Count()-1].nUCharOverread; + nUCharOverread = aParserStates.top().nUCharOverread; else - aParserStates[ aParserStates.Count()-1]. + aParserStates.top(). nUCharOverread = nUCharOverread; #endif } @@ -252,12 +249,12 @@ int SvRTFParser::_GetNextToken() if( 0 <= nOpenBrakets ) { RtfParserState_Impl aState( nUCharOverread, GetSrcEncoding() ); - aParserStates.Insert( - aState, sal::static_int_cast< sal_uInt16 >(nOpenBrakets) ); + aParserStates.push( aState ); } ++nOpenBrakets; - DBG_ASSERT( nOpenBrakets == aParserStates.Count(), - "ParserStateStack unequal to bracket count" ); + DBG_ASSERT( + static_cast<size_t>(nOpenBrakets) == aParserStates.size(), + "ParserStateStack unequal to bracket count" ); nRet = nNextCh; } break; @@ -266,12 +263,11 @@ int SvRTFParser::_GetNextToken() --nOpenBrakets; if( 0 <= nOpenBrakets ) { - aParserStates.Remove( - sal::static_int_cast< sal_uInt16 >(nOpenBrakets) ); - if( aParserStates.Count() ) + aParserStates.pop(); + if( !aParserStates.empty() ) { const RtfParserState_Impl& rRPS = - aParserStates[ aParserStates.Count() - 1 ]; + aParserStates.top(); nUCharOverread = rRPS.nUCharOverread; SetSrcEncoding( rRPS.eCodeSet ); } @@ -281,8 +277,9 @@ int SvRTFParser::_GetNextToken() SetSrcEncoding( GetCodeSet() ); } } - DBG_ASSERT( nOpenBrakets == aParserStates.Count(), - "ParserStateStack unequal to bracket count" ); + DBG_ASSERT( + static_cast<size_t>(nOpenBrakets) == aParserStates.size(), + "ParserStateStack unequal to bracket count" ); nRet = nNextCh; break; @@ -690,8 +687,8 @@ void SvRTFParser::SetEncoding( rtl_TextEncoding eEnc ) if (eEnc == RTL_TEXTENCODING_DONTKNOW) eEnc = GetCodeSet(); - if (aParserStates.Count()) - aParserStates[aParserStates.Count() - 1].eCodeSet = eEnc; + if (!aParserStates.empty()) + aParserStates.top().eCodeSet = eEnc; SetSrcEncoding(eEnc); } diff --git a/svtools/source/table/defaultinputhandler.cxx b/svtools/source/table/defaultinputhandler.cxx index 71f40b2c3503..133575fdf8cf 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/gridtablerenderer.cxx b/svtools/source/table/gridtablerenderer.cxx index 793265662773..e678daf48c03 100644 --- a/svtools/source/table/gridtablerenderer.cxx +++ b/svtools/source/table/gridtablerenderer.cxx @@ -109,7 +109,10 @@ namespace svt { namespace table DBG_ASSERT( !!pColumn, "GridTableRenderer::PaintColumnHeader: invalid column model object!" ); if ( !!pColumn ) sHeaderText = pColumn->getName(); - _rDevice.SetTextColor(m_pImpl->rModel.getTextColor()); + if(m_pImpl->rModel.getTextColor() != 0x000000) + _rDevice.SetTextColor(m_pImpl->rModel.getTextColor()); + else + _rDevice.SetTextColor(_rStyle.GetFieldTextColor()); sal_uIntPtr nHorFlag = TEXT_DRAW_LEFT; sal_uIntPtr nVerFlag = TEXT_DRAW_TOP; if(m_pImpl->rModel.getVerticalAlign() == 1) @@ -146,6 +149,11 @@ namespace svt { namespace table Color aRowBackground = m_pImpl->rModel.getOddRowBackgroundColor(); Color line = m_pImpl->rModel.getLineColor(); Color aRowBackground2 = m_pImpl->rModel.getEvenRowBackgroundColor(); + Color fieldColor = _rStyle.GetFieldColor(); + if(aRowBackground == 0xFFFFFF) + aRowBackground = fieldColor; + if(aRowBackground2 == 0xFFFFFF) + aRowBackground2 = fieldColor; //if row is selected background color becomes blue, and lines should be also blue //if they aren't user defined if(_bSelected) @@ -161,7 +169,7 @@ namespace svt { namespace table //and set line color to be the same else { - if(aRowBackground2 != 0xFFFFFF && _nRow%2) + if(aRowBackground2 != fieldColor && _nRow%2) { aRowBackground = aRowBackground2; if(line == 0xFFFFFF) @@ -170,7 +178,7 @@ namespace svt { namespace table _rDevice.SetLineColor(line); } //fill the rows with alternating background colors if second background color is specified - else if(aRowBackground != 0xFFFFFF && line == 0xFFFFFF) + else if(aRowBackground != fieldColor && line == 0xFFFFFF) _rDevice.SetLineColor(aRowBackground); else { @@ -195,7 +203,10 @@ namespace svt { namespace table _rDevice.Push( PUSH_LINECOLOR); _rDevice.SetLineColor(_rStyle.GetSeparatorColor()); _rDevice.DrawLine( _rArea.BottomLeft(), _rArea.BottomRight() ); - _rDevice.SetTextColor(m_pImpl->rModel.getTextColor()); + if(m_pImpl->rModel.getTextColor() != 0x000000) + _rDevice.SetTextColor(m_pImpl->rModel.getTextColor()); + else + _rDevice.SetTextColor(_rStyle.GetFieldTextColor()); sal_uIntPtr nHorFlag = TEXT_DRAW_LEFT; sal_uIntPtr nVerFlag = TEXT_DRAW_TOP; if(m_pImpl->rModel.getVerticalAlign() == 1) @@ -221,44 +232,42 @@ namespace svt { namespace table void GridTableRenderer::PaintCellImage( ColPos _nColumn, bool _bSelected, bool _bActive, OutputDevice& _rDevice, const Rectangle& _rArea, const StyleSettings& _rStyle, Image* _pCellData ) { - _rDevice.Push( PUSH_LINECOLOR | PUSH_FILLCOLOR | PUSH_CLIPREGION); - _rDevice.IntersectClipRegion( _rArea ); - Color background1 = m_pImpl->rModel.getOddRowBackgroundColor(); - Color background2 = m_pImpl->rModel.getEvenRowBackgroundColor(); - Color line = m_pImpl->rModel.getLineColor(); - //if row is selected and line color isn't user specified, set it blue - if(_bSelected) - { - if(line == 0xFFFFFF) - _rDevice.SetLineColor(_rStyle.GetHighlightColor()); - else - _rDevice.SetLineColor(line); - } - //else set line color to the color of row background - else - { - if(background2 != 0xFFFFFF && m_pImpl->nCurrentRow%2) + _rDevice.Push( PUSH_LINECOLOR | PUSH_FILLCOLOR); + Color background1 = m_pImpl->rModel.getOddRowBackgroundColor(); + Color background2 = m_pImpl->rModel.getEvenRowBackgroundColor(); + Color line = m_pImpl->rModel.getLineColor(); + //if row is selected and line color isn't user specified, set it blue + if(_bSelected) { if(line == 0xFFFFFF) - _rDevice.SetLineColor(background2); + _rDevice.SetLineColor(_rStyle.GetHighlightColor()); else _rDevice.SetLineColor(line); } - else if(background1 != 0xFFFFFF && line == 0xFFFFFF) - _rDevice.SetLineColor(background1); + //else set line color to the color of row background else { - //if line color is set, then it was user defined and should be visible - //if it wasn't set, it'll be the same as the default background color, so lines still won't be visible - _rDevice.SetLineColor(line); + if(background2 != 0xFFFFFF && m_pImpl->nCurrentRow%2) + { + if(line == 0xFFFFFF) + _rDevice.SetLineColor(background2); + else + _rDevice.SetLineColor(line); + } + else if(background1 != 0xFFFFFF && line == 0xFFFFFF) + _rDevice.SetLineColor(background1); + else + { + //if line color is set, then it was user defined and should be visible + //if it wasn't set, it'll be the same as the default background color, so lines still won't be visible + _rDevice.SetLineColor(line); + } } - } - _rDevice.DrawLine( _rArea.BottomRight(), _rArea.TopRight() ); - { - // TODO: remove those temporary place holders - Rectangle aRect( _rArea ); - ++aRect.Left(); --aRect.Right(); - aRect.Top(); aRect.Bottom(); + _rDevice.DrawLine( _rArea.BottomRight(), _rArea.TopRight() ); + + Rectangle aRect( _rArea ); + ++aRect.Left(); --aRect.Right(); + aRect.Top(); aRect.Bottom(); Point imagePos(Point(aRect.Left(), aRect.Top())); Size imageSize = _pCellData->GetSizePixel(); if(aRect.GetWidth() > imageSize.Width()) @@ -281,8 +290,7 @@ namespace svt { namespace table imageSize.Height() = aRect.GetHeight()-1; Image& image (*_pCellData); _rDevice.DrawImage(imagePos, imageSize, image, 0); - } - _rDevice.Pop(); + _rDevice.Pop(); (void)_bActive; // no special painting for the active cell at the moment @@ -293,48 +301,47 @@ namespace svt { namespace table OutputDevice& _rDevice, const Rectangle& _rArea, const StyleSettings& _rStyle, rtl::OUString& _rText ) { _rDevice.Push( PUSH_LINECOLOR | PUSH_FILLCOLOR ); - Color background1 = m_pImpl->rModel.getOddRowBackgroundColor(); - Color background2 = m_pImpl->rModel.getEvenRowBackgroundColor(); - Color line = m_pImpl->rModel.getLineColor(); - //if row is selected and line color isn't user specified, set it blue - if(_bSelected) - { - if(line == 0xFFFFFF) - _rDevice.SetLineColor(_rStyle.GetHighlightColor()); - else - _rDevice.SetLineColor(line); - } - //else set line color to the color of row background - else - { - if(background2 != 0xFFFFFF && m_pImpl->nCurrentRow%2) + Color background1 = m_pImpl->rModel.getOddRowBackgroundColor(); + Color background2 = m_pImpl->rModel.getEvenRowBackgroundColor(); + Color line = m_pImpl->rModel.getLineColor(); + //if row is selected and line color isn't user specified, set it blue + if(_bSelected) { if(line == 0xFFFFFF) - _rDevice.SetLineColor(background2); + _rDevice.SetLineColor(_rStyle.GetHighlightColor()); else _rDevice.SetLineColor(line); } - else if(background1 != 0xFFFFFF && line == 0xFFFFFF) - _rDevice.SetLineColor(background1); + //else set line color to the color of row background else { - //if Line color is set, then it was user defined and should be visible - //if it wasn't set, it'll be the same as the default background color, so lines still won't be visible - _rDevice.SetLineColor(line); + if(background2 != 0xFFFFFF && m_pImpl->nCurrentRow%2) + { + if(line == 0xFFFFFF) + _rDevice.SetLineColor(background2); + else + _rDevice.SetLineColor(line); + } + else if(background1 != 0xFFFFFF && line == 0xFFFFFF) + _rDevice.SetLineColor(background1); + else + { + //if Line color is set, then it was user defined and should be visible + //if it wasn't set, it'll be the same as the default background color, so lines still won't be visible + _rDevice.SetLineColor(line); + } } - } - _rDevice.DrawLine( _rArea.BottomRight(), _rArea.TopRight() ); - { - // TODO: remove those temporary place holders - Rectangle aRect( _rArea ); - ++aRect.Left(); --aRect.Right(); - aRect.Top(); aRect.Bottom(); + _rDevice.DrawLine( _rArea.BottomRight(), _rArea.TopRight() ); + + Rectangle aRect( _rArea ); + ++aRect.Left(); --aRect.Right(); + aRect.Top(); aRect.Bottom(); if(_bSelected) - { _rDevice.SetTextColor(_rStyle.GetHighlightTextColor()); - } - else + else if(m_pImpl->rModel.getTextColor() != 0x000000) _rDevice.SetTextColor(m_pImpl->rModel.getTextColor()); + else + _rDevice.SetTextColor(_rStyle.GetFieldTextColor()); sal_uIntPtr nHorFlag = TEXT_DRAW_LEFT; sal_uIntPtr nVerFlag = TEXT_DRAW_TOP; if(m_pImpl->rModel.getVerticalAlign() == 1) @@ -348,8 +355,8 @@ namespace svt { namespace table Rectangle textRect(_rArea); textRect.Left()+=4; textRect.Right()-=4; textRect.Bottom()-=2; - _rDevice.DrawText( textRect, _rText, nHorFlag | nVerFlag | TEXT_DRAW_CLIP); - } + _rDevice.DrawText( textRect, _rText, nHorFlag | nVerFlag | TEXT_DRAW_CLIP); + _rDevice.Pop(); (void)_bActive; // no special painting for the active cell at the moment diff --git a/svtools/source/table/tablecontrol.cxx b/svtools/source/table/tablecontrol.cxx index a82dc527f17d..d6122e7917a0 100644 --- a/svtools/source/table/tablecontrol.cxx +++ b/svtools/source/table/tablecontrol.cxx @@ -70,6 +70,7 @@ namespace svt { namespace table :Control( _pParent, _nStyle ) ,m_pImpl( new TableControl_Impl( *this ) ) ,m_bSelectionChanged(false) + ,m_bTooltip(false) { TableDataWindow* aTableData = m_pImpl->getDataWindow(); aTableData->SetMouseButtonDownHdl( LINK( this, TableControl, ImplMouseButtonDownHdl ) ); @@ -306,7 +307,7 @@ namespace svt { namespace table aRetText = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ColumnHeaderBar" ) ); break; case TCTYPE_TABLECELL: - aRetText = GetRowName(_nRow); + aRetText = GetAccessibleCellText(_nRow, _nCol); break; case TCTYPE_ROWHEADERCELL: aRetText = GetRowName(_nRow); @@ -389,9 +390,9 @@ namespace svt { namespace table } // ----------------------------------------------------------------------------- -::rtl::OUString TableControl::GetAccessibleCellText( sal_Int32 _nRowPos, sal_Int32 _nColPos) +::rtl::OUString TableControl::GetAccessibleCellText( sal_Int32 _nRowPos, sal_Int32 _nColPos) const { - ::com::sun::star::uno::Any cellContent = GetCellContent(_nRowPos, _nColPos); + const ::com::sun::star::uno::Any cellContent = GetCellContent(_nRowPos, _nColPos); return m_pImpl->convertToString(cellContent); } // ----------------------------------------------------------------------------- @@ -589,6 +590,7 @@ void TableControl::setTooltip(const ::com::sun::star::uno::Sequence< ::rtl::OUSt { m_aText = aText; m_nCols = nCols; + m_bTooltip = true; } // ----------------------------------------------------------------------- void TableControl::selectionChanged(bool _bChanged) @@ -596,6 +598,11 @@ void TableControl::selectionChanged(bool _bChanged) m_bSelectionChanged = _bChanged; } // ----------------------------------------------------------------------- +bool TableControl::isTooltip() +{ + return m_bTooltip; +} +// ----------------------------------------------------------------------- IMPL_LINK( TableControl, ImplSelectHdl, void*, EMPTYARG ) { Select(); diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx index 058fdca245ca..2d4b4ce84426 100644 --- a/svtools/source/table/tablecontrol_impl.cxx +++ b/svtools/source/table/tablecontrol_impl.cxx @@ -609,10 +609,10 @@ namespace svt { namespace table if(pColumn->getMinWidth() == 0 && bResizable) { pColumn->setMinWidth(1); - minColWithoutFixedSum+=m_rAntiImpl.LogicToPixel( Size( 1, 0 ), MAP_APPFONT ).Width(); + minColWithoutFixedSum+=m_rAntiImpl.PixelToLogic( Size( 1, 0 ), MAP_APPFONT ).Width(); } if(pColumn->getMaxWidth() == 0 && bResizable) - pColumn->setMaxWidth(m_rAntiImpl.LogicToPixel( Size( (int)gridWidth, 0 ), MAP_APPFONT ).Width()); + pColumn->setMaxWidth(m_rAntiImpl.PixelToLogic( Size( (int)gridWidth, 0 ), MAP_APPFONT ).Width()); if( colPrefWidth != 0) { if(m_bResizingGrid) @@ -884,6 +884,16 @@ namespace svt { namespace table // position it if ( m_pHScroll ) { + TableSize nVisibleUnits = lcl_getColumnsVisibleWithin( aDataCellPlayground, m_nLeftColumn, *this, false ); + int nRange = m_nColumnCount; + if( m_nLeftColumn + nVisibleUnits == nRange-1) + { + if(m_aAccColumnWidthsPixel[nRange-2] - m_aAccColumnWidthsPixel[m_nLeftColumn] + m_aColumnWidthsPixel[nRange-1]>aDataCellPlayground.GetWidth()) + { + m_pHScroll->SetVisibleSize( nVisibleUnits -1 ); + m_pHScroll->SetPageSize(nVisibleUnits -1); + } + } Rectangle aScrollbarArea( Point( 0, aDataCellPlayground.Bottom() + 1 ), Size( aDataCellPlayground.Right() + 1, nScrollbarMetrics ) @@ -1000,7 +1010,6 @@ namespace svt { namespace table *m_pDataWindow, aCell.getRect(), rStyle ); } } - // the area occupied by the row header, if any Rectangle aRowHeaderArea; if ( m_pModel->hasRowHeaders() ) @@ -1014,12 +1023,13 @@ namespace svt { namespace table //to avoid double lines when scrolling vertically if(m_nTopRow != 0) --aRowHeaderArea.Top(); + --aRowHeaderArea.Right(); pRenderer->PaintHeaderArea(*m_pDataWindow, aRowHeaderArea, false, true, rStyle); // Note that strictly, aRowHeaderArea also contains the intersection between column // and row header area. However, below we go to paint this intersection, again, // so this hopefully doesn't hurt if we already paint it here. - if ( getModel()->hasColumnHeaders() ) + if ( m_pModel->hasColumnHeaders() ) { TableCellGeometry aIntersection( *this, Rectangle( Point( 0, 0 ), aAllCellsWithHeaders.BottomRight() ), COL_ROW_HEADERS, ROW_COL_HEADERS ); @@ -1030,6 +1040,7 @@ namespace svt { namespace table --aInters.Top(); --aInters.Bottom(); } + --aInters.Right(); pRenderer->PaintHeaderArea( *m_pDataWindow, aInters, true, true, rStyle ); @@ -1068,6 +1079,11 @@ namespace svt { namespace table --aRect.Top(); if(m_nLeftColumn != 0) --aRect.Left(); + else + { + if(m_pModel->hasRowHeaders()) + --aRect.Left(); + } // give the redenderer a chance to prepare the row pRenderer->PrepareRow( aRowIterator.getRow(), isActiveRow, isSelectedRow, *m_pDataWindow, aRect, rStyle ); @@ -1908,6 +1924,11 @@ namespace svt { namespace table return -1; } //------------------------------------------------------------------------------- + bool TableControl_Impl::isTooltipActive() + { + return m_rAntiImpl.isTooltip(); + } + //------------------------------------------------------------------------------- ::rtl::OUString& TableControl_Impl::setTooltip(const Point& rPoint ) { ::rtl::OUString aTooltipText; @@ -2033,8 +2054,8 @@ namespace svt { namespace table { m_pDataWindow->HideTracking(); PColumnModel pColumn = m_pModel->getColumnModel(m_nResizingColumn); - int maxWidth = pColumn->getMaxWidth(); - int minWidth = pColumn->getMinWidth(); + int maxWidth = m_rAntiImpl.LogicToPixel( Size( pColumn->getMaxWidth(), 0 ), MAP_APPFONT ).Width(); + int minWidth = m_rAntiImpl.LogicToPixel( Size( pColumn->getMinWidth(), 0 ), MAP_APPFONT ).Width(); int resizeCol = m_nResizingColumn-m_nLeftColumn; //new position of mouse int actX = rPoint.X(); @@ -2044,7 +2065,7 @@ namespace svt { namespace table int leftX = 0; if(m_nResizingColumn > m_nLeftColumn) leftX = m_aVisibleColumnWidthsPixel[resizeCol-1]; - else if(m_nResizingColumn == 0 && m_pModel->hasRowHeaders()) + else if(m_nResizingColumn == m_nLeftColumn && m_pModel->hasRowHeaders()) leftX = m_rAntiImpl.LogicToPixel( Size( m_pModel->getRowHeaderWidth(), 0 ), MAP_APPFONT ).Width(); int actWidth = actX - leftX; int newActWidth = 0; @@ -2057,7 +2078,7 @@ namespace svt { namespace table pColumn->setPreferredWidth(newActWidth); } else - pColumn->setPreferredWidth(minWidth); + pColumn->setPreferredWidth(pColumn->getMinWidth()); if(m_nLeftColumn != 0) impl_updateLeftColumn(); } @@ -2069,7 +2090,7 @@ namespace svt { namespace table pColumn->setPreferredWidth(newActWidth); } else - pColumn->setPreferredWidth(maxWidth); + pColumn->setPreferredWidth(pColumn->getMaxWidth()); } m_nCurColumn = m_nResizingColumn; impl_ni_updateColumnWidths(); diff --git a/svtools/source/table/tablecontrol_impl.hxx b/svtools/source/table/tablecontrol_impl.hxx index 0d6a78fcfb54..4b3eaf177727 100644 --- a/svtools/source/table/tablecontrol_impl.hxx +++ b/svtools/source/table/tablecontrol_impl.hxx @@ -210,6 +210,7 @@ namespace svt { namespace table virtual void showCursor(); virtual bool dispatchAction( TableControlAction _eAction ); virtual SelectionEngine* getSelEngine(); + virtual bool isTooltipActive(); virtual rtl::OUString& setTooltip(const Point& rPoint ); virtual void resizeColumn(const Point& rPoint); virtual bool startResizeColumn(const Point& rPoint); diff --git a/svtools/source/table/tabledatawindow.cxx b/svtools/source/table/tabledatawindow.cxx index 3245b7e84aac..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() ); @@ -58,14 +57,33 @@ namespace svt { namespace table { m_rTableControl.doPaintContent( rUpdateRect ); } - + //-------------------------------------------------------------------- + void TableDataWindow::SetBackground( const Wallpaper& rColor ) + { + Window::SetBackground( rColor ); + } + //-------------------------------------------------------------------- + void TableDataWindow::SetControlBackground( const Color& rColor ) + { + Window::SetControlBackground( rColor ); + } + //-------------------------------------------------------------------- + void TableDataWindow::SetBackground() + { + Window::SetBackground(); + } + //-------------------------------------------------------------------- + void TableDataWindow::SetControlBackground() + { + Window::SetControlBackground(); + } //-------------------------------------------------------------------- void TableDataWindow::MouseMove( const MouseEvent& rMEvt ) { Point aPoint = rMEvt.GetPosPixel(); if ( !m_rTableControl.getInputHandler()->MouseMove( m_rTableControl, rMEvt ) ) { - if(m_rTableControl.getCurrentRow(aPoint)>=0 ) + if(m_rTableControl.getCurrentRow(aPoint)>=0 && m_rTableControl.isTooltipActive() ) { SetPointer(POINTER_ARROW); rtl::OUString& rHelpText = m_rTableControl.setTooltip(aPoint); @@ -91,23 +109,22 @@ 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 ); } - else - m_aMouseButtonDownHdl.Call((MouseEvent*) &rMEvt); } - else - m_aMouseButtonDownHdl.Call((MouseEvent*) &rMEvt); } + m_aMouseButtonDownHdl.Call((MouseEvent*) &rMEvt); m_rTableControl.getAntiImpl().LoseFocus(); } //-------------------------------------------------------------------- @@ -115,8 +132,7 @@ namespace svt { namespace table { if ( !m_rTableControl.getInputHandler()->MouseButtonUp( m_rTableControl, rMEvt ) ) Window::MouseButtonUp( rMEvt ); - else - m_aMouseButtonUpHdl.Call((MouseEvent*) &rMEvt); + m_aMouseButtonUpHdl.Call((MouseEvent*) &rMEvt); m_rTableControl.getAntiImpl().GetFocus(); } //-------------------------------------------------------------------- diff --git a/svtools/source/toolpanel/drawerlayouter.cxx b/svtools/source/toolpanel/drawerlayouter.cxx index e113961d9d15..4de76107fd20 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 3abae776cd72..7888039d8c57 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/svtxgridcontrol.cxx b/svtools/source/uno/svtxgridcontrol.cxx index 99b36c390f23..f5bc837f60b0 100755..100644 --- a/svtools/source/uno/svtxgridcontrol.cxx +++ b/svtools/source/uno/svtxgridcontrol.cxx @@ -191,7 +191,7 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An } case BASEPROPERTY_GRID_HEADER_BACKGROUND: { - sal_Int32 colorHeader = 0x000000; + sal_Int32 colorHeader = 0xFFFFFF; if( aValue >>= colorHeader ) { m_pTableModel->setHeaderBackgroundColor(colorHeader); @@ -200,7 +200,7 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An } case BASEPROPERTY_GRID_LINE_COLOR: { - sal_Int32 colorLine = 0x000000; + sal_Int32 colorLine = 0xFFFFFF; if( aValue >>= colorLine ) { m_pTableModel->setLineColor(colorLine); @@ -209,7 +209,7 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An } case BASEPROPERTY_GRID_EVEN_ROW_BACKGROUND: { - sal_Int32 colorEvenRow = 0x000000; + sal_Int32 colorEvenRow = 0xFFFFFF; if( aValue >>= colorEvenRow ) { m_pTableModel->setEvenRowBackgroundColor(colorEvenRow); @@ -218,7 +218,7 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An } case BASEPROPERTY_GRID_ROW_BACKGROUND: { - sal_Int32 colorBackground = 0x000000; + sal_Int32 colorBackground = 0xFFFFFF; if( aValue >>= colorBackground ) { m_pTableModel->setOddRowBackgroundColor(colorBackground); @@ -227,7 +227,7 @@ void SVTXGridControl::setProperty( const ::rtl::OUString& PropertyName, const An } case BASEPROPERTY_TEXTCOLOR: { - sal_Int32 colorText = 0xFFFFFF; + sal_Int32 colorText = 0x000000; if( aValue >>= colorText ) { m_pTableModel->setTextColor(colorText); @@ -673,10 +673,10 @@ void SAL_CALL SVTXGridControl::selectRows(const ::com::sun::star::uno::Sequence< if((start >= 0 && start < m_pTableModel->getRowCount()) && (end >= 0 && end < m_pTableModel->getRowCount())) { std::vector<RowPos>& selectedRows = pTable->GetSelectedRows(); - if(!selectedRows.empty()) - selectedRows.clear(); if(eSelMode == SINGLE_SELECTION) { + if(!selectedRows.empty()) + selectedRows.clear(); if(rangeOfRows.getLength() == 1) selectedRows.push_back(start); else @@ -685,7 +685,10 @@ void SAL_CALL SVTXGridControl::selectRows(const ::com::sun::star::uno::Sequence< else { for(int i=0;i<seqSize;i++) - selectedRows.push_back(rangeOfRows[i]); + { + if(!isSelectedIndex(rangeOfRows[i])) + selectedRows.push_back(rangeOfRows[i]); + } } pTable->selectionChanged(true); pTable->InvalidateDataWindow(start, end, false); @@ -713,24 +716,23 @@ void SAL_CALL SVTXGridControl::selectAllRows() throw (::com::sun::star::uno::Run SetSynthesizingVCLEvent( sal_False ); } } + void SAL_CALL SVTXGridControl::deselectRows(const ::com::sun::star::uno::Sequence< ::sal_Int32 >& rangeOfRows) throw (::com::sun::star::uno::RuntimeException) { TableControl* pTable = (TableControl*)GetWindow(); std::vector<RowPos>& selectedRows = pTable->GetSelectedRows(); std::vector<RowPos>::iterator itStart = selectedRows.begin(); std::vector<RowPos>::iterator itEnd = selectedRows.end(); - sal_Int32 start = rangeOfRows[0]; - sal_Int32 end = rangeOfRows[rangeOfRows.getLength()-1]; - if((start >= 0 && start < m_pTableModel->getRowCount()) && (end >= 0 && end < m_pTableModel->getRowCount())) + for(int i = 0; i < rangeOfRows.getLength(); i++ ) { - std::vector<RowPos>::iterator iter = std::find(itStart, itEnd, start); - selectedRows.erase(iter, iter+(end-start)+1); - pTable->selectionChanged(true); - pTable->InvalidateDataWindow(start, end, false); - SetSynthesizingVCLEvent( sal_True ); - pTable->Select(); - SetSynthesizingVCLEvent( sal_False ); + std::vector<RowPos>::iterator iter = std::find(itStart, itEnd, rangeOfRows[i]); + selectedRows.erase(iter); } + pTable->selectionChanged(true); + pTable->Invalidate(); + SetSynthesizingVCLEvent( sal_True ); + pTable->Select(); + SetSynthesizingVCLEvent( sal_False ); } void SAL_CALL SVTXGridControl::deselectAllRows() throw (::com::sun::star::uno::RuntimeException) @@ -869,7 +871,7 @@ void SVTXGridControl::ImplCallItemListeners() aEvent.Range = diff; } //selected row changed - else if(diff == 0) + else if(diff == 0 && actSelRowCount != 0) { aEvent.Row = selRows[actSelRowCount-1]; aEvent.Action = com::sun::star::awt::grid::SelectionEventType(2); diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx index 41f676f5f378..7640c813652f 100644 --- a/svtools/source/uno/toolboxcontroller.cxx +++ b/svtools/source/uno/toolboxcontroller.cxx @@ -806,7 +806,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 52ec5039262d..730d5c8e5a8b 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 aabd0b27253b..662100baa097 100644 --- a/svtools/source/uno/unoiface.cxx +++ b/svtools/source/uno/unoiface.cxx @@ -1664,7 +1664,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 5672a27ef6e4..e7ce4babf65b 100644 --- a/svtools/source/uno/unoimap.cxx +++ b/svtools/source/uno/unoimap.cxx @@ -210,6 +210,8 @@ PropertySetInfo* SvUnoImageMapObject::createPropertySetInfo( sal_uInt16 nType ) SvUnoImageMapObject::SvUnoImageMapObject( sal_uInt16 nType, const SvEventDescription* pSupportedMacroItems ) : PropertySetHelper( createPropertySetInfo( nType ) ), mnType( nType ) +, mbIsActive( true ) +, mnRadius( 0 ) { mpEvents = new SvMacroTableEventDescriptor( pSupportedMacroItems ); mpEvents->acquire(); @@ -218,6 +220,8 @@ SvUnoImageMapObject::SvUnoImageMapObject( sal_uInt16 nType, const SvEventDescrip 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/source/urlobj/inetimg.cxx b/svtools/source/urlobj/inetimg.cxx index 65a04b1d5a7c..7dd316a57f81 100644 --- a/svtools/source/urlobj/inetimg.cxx +++ b/svtools/source/urlobj/inetimg.cxx @@ -95,7 +95,7 @@ sal_Bool INetImage::Read( SvStream& rIStm, sal_uIntPtr nFormat ) /* --> structure size MUST - alignment of 4! int iSize; // size of all data, including variable length strings - BOOL bIsMap; // For server side maps + sal_Bool bIsMap; // For server side maps sal_Int32 iWidth; // Fixed size data correspond to fields in LO_ImageDataStruct sal_Int32 iHeight; // and EDT_ImageData sal_Int32 iHSpace; @@ -112,7 +112,7 @@ sal_Bool INetImage::Read( SvStream& rIStm, sal_uIntPtr nFormat ) ByteString sData; nFilePos = rIStm.Tell(); - // skip over iSize (int), bIsMao ( BOOL ) alignment of 4 !!!! + // skip over iSize (int), bIsMao ( sal_Bool ) alignment of 4 !!!! rIStm.SeekRel( 8 ); rIStm >> nVal; aSizePixel.Width() = nVal; rIStm >> nVal; aSizePixel.Height() = nVal; 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 f9c14a540410..27b46488a16c 100644 --- a/svtools/util/makefile.mk +++ b/svtools/util/makefile.mk @@ -190,3 +190,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/browser.cxx b/svtools/workben/browser.cxx index c3e924624780..98d3534b587c 100644 --- a/svtools/workben/browser.cxx +++ b/svtools/workben/browser.cxx @@ -112,12 +112,12 @@ class Browser: public BrowseBox friend class AppWindow; DataList aRows; - BOOL bInverse; + sal_Bool bInverse; Edit* pEdit; protected: virtual long GetRowCount() const; - virtual BOOL SeekRow( long nRow ); + virtual sal_Bool SeekRow( long nRow ); virtual void PaintField( OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColumnId ) const; @@ -128,7 +128,7 @@ protected: virtual void EndScroll(); virtual void Command( const CommandEvent &eEvt ); - virtual BOOL StartDragging( Pointer& rMovePtr, + virtual sal_Bool StartDragging( Pointer& rMovePtr, Pointer& rCopyPtr ); virtual void EndDragging( const DropAction &rAction ); virtual void MouseButtonDown( const BrowserMouseEvent &rEvt ); @@ -137,7 +137,7 @@ public: Browser( AppWindow* pParent, BrowserMode eMode ); ~Browser(); - void SetInverseSelection( BOOL bInverseSel ) + void SetInverseSelection( sal_Bool bInverseSel ) { bInverse = bInverseSel; } }; @@ -151,7 +151,7 @@ class AppWindow: public WorkWindow Browser aBrowser; BrowserMode eCurMode; FloatingWindow *pEventView; - ULONG nNewRowNo; + sal_uIntPtr nNewRowNo; private: DECL_LINK( Modify, void * ); @@ -341,7 +341,7 @@ BrowserMode BrowseModeDialog::GetMode() const Browser::Browser( AppWindow* pParent, BrowserMode eMode ): BrowseBox( pParent, WinBits(WB_DRAG), eMode ), - bInverse(FALSE), + bInverse(sal_False), pEdit( 0 ) { for ( long n = 0; n < 100; ++n ) @@ -369,11 +369,11 @@ Browser::~Browser() //------------------------------------------------------------------ -BOOL Browser::StartDragging( Pointer& rMovePtr, Pointer& rCopyPtr ) +sal_Bool Browser::StartDragging( Pointer& rMovePtr, Pointer& rCopyPtr ) { rMovePtr = Pointer( POINTER_MOVEDATA ); rCopyPtr = Pointer( POINTER_COPYDATA ); - return TRUE; + return sal_True; } //------------------------------------------------------------------ @@ -469,9 +469,9 @@ void Browser::CursorMoved() aEvent += String( ":", RTL_TEXTENCODING_IBM_850 ); aEvent += String( GetCurColumnId() ); ( (AppWindow*) GetParent() )->Event( aEvent ); - if ( IsFieldVisible( GetCurRow(), GetCurColumnId(), TRUE ) ) + if ( IsFieldVisible( GetCurRow(), GetCurColumnId(), sal_True ) ) ( (AppWindow*) GetParent() )->Event( String( "completely visible", RTL_TEXTENCODING_IBM_850 ) ); - else if ( IsFieldVisible( 1, GetCurColumnId(), FALSE) ) + else if ( IsFieldVisible( 1, GetCurColumnId(), sal_False) ) ( (AppWindow*) GetParent() )->Event( String( "partly visible", RTL_TEXTENCODING_IBM_850 ) ); else ( (AppWindow*) GetParent() )->Event( String( "not visible", RTL_TEXTENCODING_IBM_850 ) ); @@ -488,14 +488,14 @@ long Browser::GetRowCount() const //------------------------------------------------------------------ -BOOL Browser::SeekRow( long nRow ) +sal_Bool Browser::SeekRow( long nRow ) { if ( nRow >= 0 && nRow < (long) aRows.Count() ) { aRows.Seek(nRow); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } //------------------------------------------------------------------ @@ -583,7 +583,7 @@ IMPL_LINK_INLINE_START( AppWindow, Modify, void *, pCaller ) aBrowser.GoToRow( pEdit->GetText().ToInt32() ); aBrowser.GrabFocus(); - return TRUE; + return sal_True; } IMPL_LINK_INLINE_END( AppWindow, Modify, void *, pCaller ) @@ -591,7 +591,7 @@ IMPL_LINK_INLINE_END( AppWindow, Modify, void *, pCaller ) IMPL_LINK( AppWindow, MenuSelect, Menu *, pMenu ) { - ULONG nPos; + sal_uIntPtr nPos; switch ( pMenu->GetCurItemId() ) { @@ -726,7 +726,7 @@ IMPL_LINK( AppWindow, MenuSelect, Menu *, pMenu ) case MID_INVERSE: { - BOOL bChecked = pMenu->IsItemChecked( MID_INVERSE ); + sal_Bool bChecked = pMenu->IsItemChecked( MID_INVERSE ); pMenu->CheckItem( MID_INVERSE, !bChecked ); aBrowser.SetInverseSelection( !bChecked ); break; @@ -739,14 +739,14 @@ IMPL_LINK( AppWindow, MenuSelect, Menu *, pMenu ) case MID_STARMONEY_1: { nPos = aBrowser.GetCurRow(); - aBrowser.SelectRow( nPos + 1, TRUE ); + aBrowser.SelectRow( nPos + 1, sal_True ); aBrowser.aRows.Remove( nPos ); aBrowser.RowRemoved( nPos ); break; } } - return TRUE; + return sal_True; } //------------------------------------------------------------------ diff --git a/svtools/workben/stest.cxx b/svtools/workben/stest.cxx index c788eb67c28e..ca6c8a757734 100644 --- a/svtools/workben/stest.cxx +++ b/svtools/workben/stest.cxx @@ -124,7 +124,7 @@ IMPL_LINK( SearchWindow, ClickHdl, Button *, pButton ) /* InfoBox( this, String( "T: " ) + sText + String( "\nS: " ) + sSrch ).Execute(); */ - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; sal_uInt16 nStt = 0, nEnd = sText.Len(); { @@ -132,7 +132,7 @@ IMPL_LINK( SearchWindow, ClickHdl, Button *, pButton ) SearchText aSrchText( aParam, GetpApp()->GetAppInternational() ); bRet = aSrchText.SearchFrwrd( sText, &nStt, &nEnd ); -// BOOL SearchBkwrd( const String &rStr, sal_uInt16* pStart, sal_uInt16* pEnde ); +// sal_Bool SearchBkwrd( const String &rStr, sal_uInt16* pStart, sal_uInt16* pEnde ); } String sFound( "gefunden" ); diff --git a/svtools/workben/svdem.cxx b/svtools/workben/svdem.cxx index 4dadea4f78a4..fe3afcc20ea5 100644 --- a/svtools/workben/svdem.cxx +++ b/svtools/workben/svdem.cxx @@ -78,7 +78,7 @@ public: ShowBitmap( Window* pParent, const Bitmap& rBmp ); virtual void Paint( const Rectangle& ); - virtual BOOL Close(); + virtual sal_Bool Close(); }; // ----------------------------------------------------------------------- @@ -282,11 +282,11 @@ void ShowBitmap::Paint( const Rectangle& ) // ----------------------------------------------------------------------- -BOOL ShowBitmap::Close() +sal_Bool ShowBitmap::Close() { Hide(); delete this; - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -352,8 +352,8 @@ MyFontDialog::MyFontDialog( Window* pParent ) : { pList = NULL; - aFontBox.EnableWYSIWYG( TRUE ); - aFontBox.EnableSymbols( TRUE ); + aFontBox.EnableWYSIWYG( sal_True ); + aFontBox.EnableSymbols( sal_True ); aFontBox.SetPosSizePixel( Point( 10, 10 ), Size( 140, 140 ) ); aFontBox.SetSelectHdl( LINK( this, MyFontDialog, SelectFont ) ); aFontBox.SetLoseFocusHdl( LINK( this, MyFontDialog, SelectFont ) ); @@ -421,7 +421,7 @@ MyFontDialog::MyFontDialog( Window* pParent ) : { aColorBox.SetPosSizePixel( Point( 15, 305 ), Size( 130, 100 ) ); aColorBox.SetSelectHdl( LINK( this, MyFontDialog, AttrHdl ) ); - aColorBox.SetUpdateMode( FALSE ); + aColorBox.SetUpdateMode( sal_False ); aColorBox.InsertEntry( Color( COL_BLACK ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Black" ) ) ); aColorBox.InsertEntry( Color( COL_BLUE ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Blue" ) ) ); aColorBox.InsertEntry( Color( COL_GREEN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Green" ) ) ); @@ -438,7 +438,7 @@ MyFontDialog::MyFontDialog( Window* pParent ) : aColorBox.InsertEntry( Color( COL_LIGHTMAGENTA ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightMagenta" ) ) ); aColorBox.InsertEntry( Color( COL_YELLOW ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Yellow" ) ) ); aColorBox.InsertEntry( Color( COL_WHITE ), XubString( RTL_CONSTASCII_USTRINGPARAM( "White" ) ) ); - aColorBox.SetUpdateMode( TRUE ); + aColorBox.SetUpdateMode( sal_True ); aColorBox.Show(); } @@ -515,7 +515,7 @@ void MyFontDialog::SetAttr() aFont.SetShadow( aShadowBox.IsChecked() ); aFont.SetOutline( aOutlineBox.IsChecked() ); aFont.SetOrientation( aLineOrientSlider.GetOrientation() ); - aFont.SetTransparent( TRUE ); + aFont.SetTransparent( sal_True ); aMapText.SetText( pList->GetFontMapText( aFont ) ); aShowFont.SetFont( aFont ); } @@ -545,12 +545,12 @@ long MyTabBar::DeactivatePage() QueryBox aQueryBox( this, WB_YES_NO | WB_DEF_YES, XubString( RTL_CONSTASCII_USTRINGPARAM( "Deactivate" ) ) ); if ( aQueryBox.Execute() == RET_YES ) - return TRUE; + return sal_True; else - return FALSE; + return sal_False; } else - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -750,7 +750,7 @@ MyWin::MyWin( Window* pParent, WinBits aWinStyle ) : { aColorList.SetPosSizePixel( Point( 10, nY ), Size( 130, 180 ) ); - aColorList.SetUpdateMode( FALSE ); + aColorList.SetUpdateMode( sal_False ); aColorList.InsertEntry( Color( COL_BLACK ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Black" ) ) ); aColorList.InsertEntry( Color( COL_BLUE ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Blue" ) ) ); aColorList.InsertEntry( Color( COL_GREEN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Green" ) ) ); @@ -767,7 +767,7 @@ MyWin::MyWin( Window* pParent, WinBits aWinStyle ) : aColorList.InsertEntry( Color( COL_LIGHTMAGENTA ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightMagenta" ) ) ); aColorList.InsertEntry( Color( COL_YELLOW ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Yellow" ) ) ); aColorList.InsertEntry( Color( COL_WHITE ), XubString( RTL_CONSTASCII_USTRINGPARAM( "White" ) ) ); - aColorList.SetUpdateMode( TRUE ); + aColorList.SetUpdateMode( sal_True ); aColorList.SetSelectHdl( LINK( this, MyWin, SelectHdl ) ); aColorList.Show(); } @@ -818,7 +818,7 @@ MyWin::MyWin( Window* pParent, WinBits aWinStyle ) : } { - aCalendarField.EnableEmptyFieldValue( TRUE ); + aCalendarField.EnableEmptyFieldValue( sal_True ); aCalendarField.SetCalendarStyle( aCalendarField.GetCalendarStyle() | WB_RANGESELECT ); aCalendarField.SetSelectHdl( LINK( this, MyWin, CalSelectHdl ) ); // aCalendarField.SetDate( Date() ); diff --git a/svtools/workben/toolpanel/toolpaneltest.cxx b/svtools/workben/toolpanel/toolpaneltest.cxx index 60c5e277707f..d7656b105fc9 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; }; |