diff options
author | Vladimir Glazunov <vg@openoffice.org> | 2009-12-10 18:31:30 +0100 |
---|---|---|
committer | Vladimir Glazunov <vg@openoffice.org> | 2009-12-10 18:31:30 +0100 |
commit | d882dd49fafcde4c110a598b5b23516da1d1abcb (patch) | |
tree | f89f7296673422c93a83f7b5c6e8107bde712608 | |
parent | feab692f6477e4312f3da0d7259d0d0ed7eeaecb (diff) | |
parent | b48c0ede8f74ff21415a216a08001e3a129c23f3 (diff) |
CWS-TOOLING: integrate CWS vcl107
-rw-r--r-- | rsc/inc/rsctools.hxx | 44 | ||||
-rw-r--r-- | svtools/inc/imgdef.hxx | 11 | ||||
-rw-r--r-- | svtools/source/config/miscopt.cxx | 42 | ||||
-rw-r--r-- | vcl/aqua/inc/salframe.h | 3 | ||||
-rw-r--r-- | vcl/aqua/source/window/salframe.cxx | 24 | ||||
-rw-r--r-- | vcl/inc/vcl/dialog.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/vcl/impimagetree.hxx | 22 | ||||
-rw-r--r-- | vcl/inc/vcl/pdfwriter.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/vcl/salframe.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/vcl/settings.hxx | 9 | ||||
-rw-r--r-- | vcl/inc/vcl/syswin.hxx | 4 | ||||
-rw-r--r-- | vcl/inc/vcl/toolbox.h | 1 | ||||
-rw-r--r-- | vcl/source/app/salvtables.cxx | 7 | ||||
-rwxr-xr-x | vcl/source/app/settings.cxx | 49 | ||||
-rw-r--r-- | vcl/source/gdi/base14.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/impimagetree.cxx | 60 | ||||
-rw-r--r-- | vcl/source/gdi/outdev.cxx | 13 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 233 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.hxx | 7 | ||||
-rw-r--r-- | vcl/source/gdi/region.cxx | 8 | ||||
-rw-r--r-- | vcl/source/window/accmgr.cxx | 17 | ||||
-rw-r--r-- | vcl/source/window/dialog.cxx | 14 | ||||
-rw-r--r-- | vcl/source/window/syswin.cxx | 24 | ||||
-rw-r--r-- | vcl/source/window/toolbox2.cxx | 3 |
24 files changed, 483 insertions, 118 deletions
diff --git a/rsc/inc/rsctools.hxx b/rsc/inc/rsctools.hxx index eb9f8937b939..fd8e49135eb0 100644 --- a/rsc/inc/rsctools.hxx +++ b/rsc/inc/rsctools.hxx @@ -138,28 +138,41 @@ public: sal_uInt32 Size(){ return( nLen ); }; void Put( sal_uInt64 lVal ) { + union + { + sal_uInt64 lVal64; + sal_uInt32 aVal32[2]; + }; + lVal64 = lVal; if( bSwap ) { - Put( *(((sal_uInt32*)&lVal)+1) ); - Put( *(sal_uInt32*)&lVal ); + Put( aVal32[1] ); + Put( aVal32[0] ); } else { - Put( *(sal_uInt32*)&lVal ); - Put( *(((sal_uInt32*)&lVal)+1) ); + Put( aVal32[0] ); + Put( aVal32[1] ); } } void Put( sal_Int32 lVal ) { + union + { + sal_uInt32 lVal32; + sal_uInt16 aVal16[2]; + }; + lVal32 = lVal; + if( bSwap ) { - Put( *(((sal_uInt16*)&lVal) +1) ); - Put( *(sal_uInt16*)&lVal ); + Put( aVal16[1] ); + Put( aVal16[0] ); } else { - Put( *(sal_uInt16*)&lVal ); - Put( *(((sal_uInt16*)&lVal) +1) ); + Put( aVal16[0] ); + Put( aVal16[1] ); } } void Put( sal_uInt32 nValue ) @@ -171,15 +184,22 @@ public: void PutAt( sal_uInt32 nPos, INT32 lVal ) { + union + { + sal_uInt32 lVal32; + sal_uInt16 aVal16[2]; + }; + lVal32 = lVal; + if( bSwap ) { - PutAt( nPos, *(((sal_uInt16*)&lVal) +1) ); - PutAt( nPos + 2, *(sal_uInt16*)&lVal ); + PutAt( nPos, aVal16[1] ); + PutAt( nPos + 2, aVal16[0] ); } else { - PutAt( nPos, *(sal_uInt16*)&lVal ); - PutAt( nPos + 2, *(((sal_uInt16*)&lVal) +1) ); + PutAt( nPos, aVal16[0] ); + PutAt( nPos + 2, aVal16[1] ); } } void PutAt( sal_uInt32 nPos, sal_uInt32 lVal ) diff --git a/svtools/inc/imgdef.hxx b/svtools/inc/imgdef.hxx index e5b682d91bfe..2881fe5150bc 100644 --- a/svtools/inc/imgdef.hxx +++ b/svtools/inc/imgdef.hxx @@ -38,17 +38,6 @@ enum SfxSymbolsSize SFX_SYMBOLS_SIZE_AUTO }; -enum SfxSymbolsStyle -{ - SFX_SYMBOLS_STYLE_AUTO, - SFX_SYMBOLS_STYLE_DEFAULT, - SFX_SYMBOLS_STYLE_HICONTRAST, - SFX_SYMBOLS_STYLE_INDUSTRIAL, - SFX_SYMBOLS_STYLE_CRYSTAL, - SFX_SYMBOLS_STYLE_TANGO, - SFX_SYMBOLS_STYLE_CLASSIC -}; - #define SFX_TOOLBOX_CHANGESYMBOLSET 0x0001 #define SFX_TOOLBOX_CHANGEOUTSTYLE 0x0002 #define SFX_TOOLBOX_CHANGEBUTTONTYPE 0x0004 diff --git a/svtools/source/config/miscopt.cxx b/svtools/source/config/miscopt.cxx index ace9f710baa3..af6861a5104f 100644 --- a/svtools/source/config/miscopt.cxx +++ b/svtools/source/config/miscopt.cxx @@ -256,42 +256,6 @@ class SvtMiscOptions_Impl : public ConfigItem void ImplSetSymbolsStyle( bool bValue, sal_Int16 nSet, const ::rtl::OUString &rName ); }; -//_________________________________________________________________________________________________________________ -// definitions -//_________________________________________________________________________________________________________________ - -static sal_Int16 implSymbolsStyleFromVCL( ULONG nStyle ) -{ - switch ( nStyle ) - { - case STYLE_SYMBOLS_AUTO: return SFX_SYMBOLS_STYLE_AUTO; - case STYLE_SYMBOLS_DEFAULT: return SFX_SYMBOLS_STYLE_DEFAULT; - case STYLE_SYMBOLS_HICONTRAST: return SFX_SYMBOLS_STYLE_HICONTRAST; - case STYLE_SYMBOLS_INDUSTRIAL: return SFX_SYMBOLS_STYLE_INDUSTRIAL; - case STYLE_SYMBOLS_CRYSTAL: return SFX_SYMBOLS_STYLE_CRYSTAL; - case STYLE_SYMBOLS_TANGO: return SFX_SYMBOLS_STYLE_TANGO; - case STYLE_SYMBOLS_CLASSIC: return SFX_SYMBOLS_STYLE_CLASSIC; - } - - return SFX_SYMBOLS_STYLE_AUTO; -} - -static ULONG implSymbolsStyleToVCL( sal_Int16 nStyle ) -{ - switch ( nStyle ) - { - case SFX_SYMBOLS_STYLE_AUTO: return STYLE_SYMBOLS_AUTO; - case SFX_SYMBOLS_STYLE_DEFAULT: return STYLE_SYMBOLS_DEFAULT; - case SFX_SYMBOLS_STYLE_HICONTRAST: return STYLE_SYMBOLS_HICONTRAST; - case SFX_SYMBOLS_STYLE_INDUSTRIAL: return STYLE_SYMBOLS_INDUSTRIAL; - case SFX_SYMBOLS_STYLE_CRYSTAL: return STYLE_SYMBOLS_CRYSTAL; - case SFX_SYMBOLS_STYLE_TANGO: return STYLE_SYMBOLS_TANGO; - case SFX_SYMBOLS_STYLE_CLASSIC: return STYLE_SYMBOLS_CLASSIC; - } - - return STYLE_SYMBOLS_AUTO; -} - //***************************************************************************************************************** // constructor //***************************************************************************************************************** @@ -539,7 +503,7 @@ void SvtMiscOptions_Impl::SetSymbolsSize( sal_Int16 nSet ) sal_Int16 SvtMiscOptions_Impl::GetSymbolsStyle() const { - return implSymbolsStyleFromVCL( Application::GetSettings().GetStyleSettings().GetSymbolsStyle() ); + return (sal_Int16)Application::GetSettings().GetStyleSettings().GetSymbolsStyle(); } ::rtl::OUString SvtMiscOptions_Impl::GetSymbolsStyleName() const @@ -549,7 +513,7 @@ sal_Int16 SvtMiscOptions_Impl::GetSymbolsStyle() const sal_Int16 SvtMiscOptions_Impl::GetCurrentSymbolsStyle() const { - return implSymbolsStyleFromVCL( Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyle() ); + return (sal_Int16)Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyle(); } void SvtMiscOptions_Impl::ImplSetSymbolsStyle( bool bValue, sal_Int16 nSet, const ::rtl::OUString &rName ) @@ -561,7 +525,7 @@ void SvtMiscOptions_Impl::ImplSetSymbolsStyle( bool bValue, sal_Int16 nSet, cons StyleSettings aStyleSettings = aAllSettings.GetStyleSettings(); if ( bValue ) - aStyleSettings.SetSymbolsStyle( implSymbolsStyleToVCL( nSet ) ); + aStyleSettings.SetSymbolsStyle( nSet ); else aStyleSettings.SetSymbolsStyleName( rName ); diff --git a/vcl/aqua/inc/salframe.h b/vcl/aqua/inc/salframe.h index 1d1eb3cb6bd3..5ddd96dae34d 100644 --- a/vcl/aqua/inc/salframe.h +++ b/vcl/aqua/inc/salframe.h @@ -121,6 +121,7 @@ public: virtual BOOL PostEvent( void* pData ); virtual void SetTitle( const XubString& rTitle ); virtual void SetIcon( USHORT nIcon ); + virtual void SetRepresentedURL( const rtl::OUString& ); virtual void SetMenu( SalMenu* pSalMenu ); virtual void DrawMenuBar(); virtual void Show( BOOL bVisible, BOOL bNoActivate = FALSE ); @@ -140,7 +141,7 @@ public: virtual void SetPointer( PointerStyle ePointerStyle ); virtual void CaptureMouse( BOOL bMouse ); virtual void SetPointerPos( long nX, long nY ); - virtual void Flush( void); + virtual void Flush( void ); virtual void Flush( const Rectangle& ); virtual void Sync(); virtual void SetInputContext( SalInputContext* pContext ); diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx index b942c97cead1..7fe3b93ef2e8 100644 --- a/vcl/aqua/source/window/salframe.cxx +++ b/vcl/aqua/source/window/salframe.cxx @@ -54,10 +54,7 @@ #include "boost/assert.hpp" #include "vcl/svapp.hxx" #include "rtl/ustrbuf.hxx" - -#include <premac.h> -#include <CoreFoundation/CoreFoundation.h> -#include <postmac.h> +#include "osl/file.h" using namespace std; @@ -329,8 +326,25 @@ void AquaSalFrame::SetTitle(const XubString& rTitle) // ----------------------------------------------------------------------- -void AquaSalFrame::SetIcon( USHORT nIcon ) +void AquaSalFrame::SetIcon( USHORT ) +{ +} + +// ----------------------------------------------------------------------- + +void AquaSalFrame::SetRepresentedURL( const rtl::OUString& i_rDocURL ) { + if( i_rDocURL.indexOfAsciiL( "file:", 5 ) == 0 ) + { + rtl::OUString aSysPath; + osl_getSystemPathFromFileURL( i_rDocURL.pData, &aSysPath.pData ); + NSString* pStr = CreateNSString( aSysPath ); + if( pStr ) + { + [pStr autorelease]; + [mpWindow setRepresentedFilename: pStr]; + } + } } // ----------------------------------------------------------------------- diff --git a/vcl/inc/vcl/dialog.hxx b/vcl/inc/vcl/dialog.hxx index f34db3a2a5db..c5f032dfff82 100644 --- a/vcl/inc/vcl/dialog.hxx +++ b/vcl/inc/vcl/dialog.hxx @@ -65,6 +65,7 @@ private: SAL_DLLPRIVATE Dialog (const Dialog &); SAL_DLLPRIVATE Dialog & operator= (const Dialog &); + DECL_DLLPRIVATE_LINK( ImplAsyncCloseHdl, void* ); protected: using Window::ImplInit; SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle ); diff --git a/vcl/inc/vcl/impimagetree.hxx b/vcl/inc/vcl/impimagetree.hxx index dfbcb366fe6a..92761eabdf3c 100644 --- a/vcl/inc/vcl/impimagetree.hxx +++ b/vcl/inc/vcl/impimagetree.hxx @@ -54,14 +54,17 @@ public: ~ImplImageTree(); + // check whether the icon style is installed + bool checkStyle(rtl::OUString const & style); + bool loadImage( rtl::OUString const & name, rtl::OUString const & style, - BitmapEx & bitmap, bool localized = false); + BitmapEx & bitmap, bool localized = false ); void shutDown(); // a crude form of life cycle control (called from DeInitVCL; otherwise, // if the ImplImageTree singleton were destroyed during exit that would - // be too late for the destructors of the bitmaps in m_cache) + // be too late for the destructors of the bitmaps in m_iconCache) private: typedef std::list< @@ -71,20 +74,23 @@ private: com::sun::star::container::XNameAccess > > > Zips; typedef std::hash_map< - rtl::OUString, std::pair< bool, BitmapEx >, rtl::OUStringHash > Cache; + rtl::OUString, bool, rtl::OUStringHash > CheckStyleCache; + typedef std::hash_map< + rtl::OUString, std::pair< bool, BitmapEx >, rtl::OUStringHash > IconCache; rtl::OUString m_style; Zips m_zips; - Cache m_cache; + CheckStyleCache m_checkStyleCache; + IconCache m_iconCache; - void setStyle(rtl::OUString const & style); + void setStyle(rtl::OUString const & style ); void resetZips(); - bool cacheLookup( - rtl::OUString const & name, bool localized, BitmapEx & bitmap); + bool checkStyleCacheLookup( rtl::OUString const & style, bool &exists ); + bool iconCacheLookup( rtl::OUString const & name, bool localized, BitmapEx & bitmap ); - bool find(std::vector< rtl::OUString > const & paths, BitmapEx & bitmap); + bool find(std::vector< rtl::OUString > const & paths, BitmapEx & bitmap ); }; typedef salhelper::SingletonRef< ImplImageTree > ImplImageTreeSingletonRef; diff --git a/vcl/inc/vcl/pdfwriter.hxx b/vcl/inc/vcl/pdfwriter.hxx index a4a6c4d53170..dbfaf9eda18d 100644 --- a/vcl/inc/vcl/pdfwriter.hxx +++ b/vcl/inc/vcl/pdfwriter.hxx @@ -547,6 +547,7 @@ The following structure describes the permissions used in PDF security */ PDFWriter::ExportDataFormat SubmitFormat; bool AllowDuplicateFieldNames; + bool FieldsUseSystemFonts; /* the following data members are used to customize the PDF viewer preferences */ @@ -592,6 +593,7 @@ The following structure describes the permissions used in PDF security EmbedStandardFonts( false ), SubmitFormat( PDFWriter::FDF ), AllowDuplicateFieldNames( false ), + FieldsUseSystemFonts( true ), PDFDocumentMode( PDFWriter::ModeDefault ), PDFDocumentAction( PDFWriter::ActionDefault ), Zoom( 100 ), diff --git a/vcl/inc/vcl/salframe.hxx b/vcl/inc/vcl/salframe.hxx index 0e3f4e94a0b3..b95f7036ad19 100644 --- a/vcl/inc/vcl/salframe.hxx +++ b/vcl/inc/vcl/salframe.hxx @@ -170,6 +170,7 @@ public: virtual void SetTitle( const XubString& rTitle ) = 0; virtual void SetIcon( USHORT nIcon ) = 0; + virtual void SetRepresentedURL( const rtl::OUString& ); virtual void SetMenu( SalMenu *pSalMenu ) = 0; virtual void DrawMenuBar() = 0; diff --git a/vcl/inc/vcl/settings.hxx b/vcl/inc/vcl/settings.hxx index 8891fdcfcf14..61a970b738e0 100644 --- a/vcl/inc/vcl/settings.hxx +++ b/vcl/inc/vcl/settings.hxx @@ -522,9 +522,10 @@ private: #define STYLE_SYMBOLS_HICONTRAST ((ULONG)2) #define STYLE_SYMBOLS_INDUSTRIAL ((ULONG)3) #define STYLE_SYMBOLS_CRYSTAL ((ULONG)4) -#define STYLE_SYMBOLS_TANGO ((ULONG)5) -#define STYLE_SYMBOLS_CLASSIC ((ULONG)6) -#define STYLE_SYMBOLS_THEMES_MAX ((ULONG)6) +#define STYLE_SYMBOLS_TANGO ((ULONG)5) +#define STYLE_SYMBOLS_OXYGEN ((ULONG)6) +#define STYLE_SYMBOLS_CLASSIC ((ULONG)7) +#define STYLE_SYMBOLS_THEMES_MAX ((ULONG)8) #define STYLE_CURSOR_NOBLINKTIME ((ULONG)0xFFFFFFFF) @@ -948,6 +949,8 @@ public: void SetPreferredSymbolsStyleName( const ::rtl::OUString &rName ); ULONG GetPreferredSymbolsStyle() const { return mpData->mnPreferredSymbolsStyle; } + // check whether the symbols style is supported (icons are installed) + bool CheckSymbolStyle( ULONG nStyle ) const; ULONG GetAutoSymbolsStyle() const; ULONG GetCurrentSymbolsStyle() const; diff --git a/vcl/inc/vcl/syswin.hxx b/vcl/inc/vcl/syswin.hxx index 99a340ae4a58..d590cfe0a37e 100644 --- a/vcl/inc/vcl/syswin.hxx +++ b/vcl/inc/vcl/syswin.hxx @@ -201,6 +201,10 @@ public: void SetIcon( USHORT nIcon ); USHORT GetIcon() const { return mnIcon; } + // for systems like MacOSX which can display the URL a document is loaded from + // separately from the window title + void SetRepresentedURL( const rtl::OUString& ); + const rtl::OUString& GetRepresentedURL() const; void SetZLevel( BYTE nLevel ); BYTE GetZLevel() const; diff --git a/vcl/inc/vcl/toolbox.h b/vcl/inc/vcl/toolbox.h index 52a0db40b226..2dee85ab6b82 100644 --- a/vcl/inc/vcl/toolbox.h +++ b/vcl/inc/vcl/toolbox.h @@ -51,6 +51,7 @@ #define TB_LARGEIMAGESIZE 26 #define TB_LARGEIMAGESIZE_INDUSTRIAL 24 #define TB_LARGEIMAGESIZE_CRYSTAL 22 +#define TB_LARGEIMAGESIZE_OXYGEN 22 class Window; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 9d398aef10cd..516b23dd76be 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -61,6 +61,13 @@ void SalFrame::Flush( const Rectangle& ) // ----------------------------------------------------------------------- +void SalFrame::SetRepresentedURL( const rtl::OUString& ) +{ + // currently this is Mac only functionality +} + +// ----------------------------------------------------------------------- + SalInstance::~SalInstance() { } diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 10db065af0c7..bd90d8824d91 100755 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -41,6 +41,8 @@ #include "vcl/configsettings.hxx" #include "vcl/gradient.hxx" #include "vcl/unohelp.hxx" +#include "vcl/bitmapex.hxx" +#include "vcl/impimagetree.hxx" #include "unotools/localedatawrapper.hxx" #include "unotools/collatorwrapper.hxx" #include "unotools/configmgr.hxx" @@ -706,6 +708,7 @@ void StyleSettings::Set3DColors( const Color& rColor ) case STYLE_SYMBOLS_INDUSTRIAL: return ::rtl::OUString::createFromAscii( "industrial" ); case STYLE_SYMBOLS_CRYSTAL: return ::rtl::OUString::createFromAscii( "crystal" ); case STYLE_SYMBOLS_TANGO: return ::rtl::OUString::createFromAscii( "tango" ); + case STYLE_SYMBOLS_OXYGEN: return ::rtl::OUString::createFromAscii( "oxygen" ); case STYLE_SYMBOLS_CLASSIC: return ::rtl::OUString::createFromAscii( "classic" ); } @@ -726,6 +729,8 @@ ULONG StyleSettings::ImplNameToSymbolsStyle( const ::rtl::OUString &rName ) cons return STYLE_SYMBOLS_CRYSTAL; else if ( rName == ::rtl::OUString::createFromAscii( "tango" ) ) return STYLE_SYMBOLS_TANGO; + else if ( rName == ::rtl::OUString::createFromAscii( "oxygen" ) ) + return STYLE_SYMBOLS_OXYGEN; else if ( rName == ::rtl::OUString::createFromAscii( "classic" ) ) return STYLE_SYMBOLS_CLASSIC; @@ -759,12 +764,12 @@ ULONG StyleSettings::GetCurrentSymbolsStyle() const // style selected in Tools -> Options... -> OpenOffice.org -> View ULONG nStyle = GetSymbolsStyle(); - if ( nStyle == STYLE_SYMBOLS_AUTO ) + if ( nStyle == STYLE_SYMBOLS_AUTO || ( !CheckSymbolStyle (nStyle) ) ) { // the preferred style can be read from the desktop setting by the desktop native widgets modules ULONG nPreferredStyle = GetPreferredSymbolsStyle(); - if ( nPreferredStyle == STYLE_SYMBOLS_AUTO ) + if ( nPreferredStyle == STYLE_SYMBOLS_AUTO || ( !CheckSymbolStyle (nPreferredStyle) ) ) { // use a hardcoded desktop-specific fallback if no preferred style has been detected @@ -780,7 +785,10 @@ ULONG StyleSettings::GetCurrentSymbolsStyle() const nPreferredStyle = snFallbackDesktopStyle; } - nStyle = GetHighContrastMode()? STYLE_SYMBOLS_HICONTRAST: nPreferredStyle; + if (GetHighContrastMode() && CheckSymbolStyle (STYLE_SYMBOLS_HICONTRAST) ) + nStyle = STYLE_SYMBOLS_HICONTRAST; + else + nStyle = nPreferredStyle; } return nStyle; @@ -814,6 +822,33 @@ ULONG StyleSettings::GetAutoSymbolsStyle() const nRet = STYLE_SYMBOLS_TANGO; else if( rDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "kde" ) ) nRet = STYLE_SYMBOLS_CRYSTAL; + else if( rDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "kde4" ) ) + nRet = STYLE_SYMBOLS_OXYGEN; + } + + // falback to any existing style + if ( ! CheckSymbolStyle (nRet) ) + { + for ( ULONG n = 0 ; n <= STYLE_SYMBOLS_THEMES_MAX ; n++ ) + { + ULONG nStyleToCheck = n; + + // auto is not a real theme => can't be fallback + if ( nStyleToCheck == STYLE_SYMBOLS_AUTO ) + continue; + + // will check hicontrast in the end + if ( nStyleToCheck == STYLE_SYMBOLS_HICONTRAST ) + continue; + if ( nStyleToCheck == STYLE_SYMBOLS_THEMES_MAX ) + nStyleToCheck = STYLE_SYMBOLS_HICONTRAST; + + if ( CheckSymbolStyle ( nStyleToCheck ) ) + { + nRet = nStyleToCheck; + n = STYLE_SYMBOLS_THEMES_MAX; + } + } } return nRet; @@ -821,6 +856,14 @@ ULONG StyleSettings::GetAutoSymbolsStyle() const // ----------------------------------------------------------------------- +bool StyleSettings::CheckSymbolStyle( ULONG nStyle ) const +{ + static ImplImageTreeSingletonRef aImageTree; + return aImageTree->checkStyle( ImplSymbolsStyleToName( nStyle ) ); +} + +// ----------------------------------------------------------------------- + void StyleSettings::SetStandardStyles() { CopyData(); diff --git a/vcl/source/gdi/base14.cxx b/vcl/source/gdi/base14.cxx index 17e616d196b4..56d1c3ff5eba 100644 --- a/vcl/source/gdi/base14.cxx +++ b/vcl/source/gdi/base14.cxx @@ -601,7 +601,7 @@ const PDFWriterImpl::BuiltinFont PDFWriterImpl::m_aBuiltinFonts[ 14 ] = { "Symbol", // PSName 1010, -293, // ascend, descend FAMILY_DONTKNOW, // family style - RTL_TEXTENCODING_SYMBOL, // charset + RTL_TEXTENCODING_ADOBE_SYMBOL, // charset PITCH_VARIABLE, // pitch WIDTH_NORMAL, // width type WEIGHT_NORMAL, // weight type diff --git a/vcl/source/gdi/impimagetree.cxx b/vcl/source/gdi/impimagetree.cxx index 039041826124..8178204a4ffd 100644 --- a/vcl/source/gdi/impimagetree.cxx +++ b/vcl/source/gdi/impimagetree.cxx @@ -46,6 +46,7 @@ #include "com/sun/star/uno/RuntimeException.hpp" #include "com/sun/star/uno/Sequence.hxx" #include "comphelper/processfactory.hxx" +#include "osl/file.hxx" #include "osl/diagnose.h" #include "rtl/bootstrap.hxx" #include "rtl/string.h" @@ -118,12 +119,43 @@ ImplImageTree::ImplImageTree() {} ImplImageTree::~ImplImageTree() {} +bool ImplImageTree::checkStyle(rtl::OUString const & style) +{ + bool exists; + + // using cache because setStyle is an expensive operation + // setStyle calls resetZips => closes any opened zip files with icons, cleans the icon cache, ... + if (checkStyleCacheLookup(style, exists)) { + return exists; + } + + setStyle(style); + + exists = false; + const rtl::OUString sBrandURLSuffix(RTL_CONSTASCII_USTRINGPARAM("_brand.zip")); + for (Zips::iterator i(m_zips.begin()); i != m_zips.end() && !exists;) { + ::rtl::OUString aZipURL = i->first; + sal_Int32 nFromIndex = aZipURL.getLength() - sBrandURLSuffix.getLength(); + // skip brand-specific icon themes; they are incomplete and thus not useful for this check + if (nFromIndex < 0 || !aZipURL.match(sBrandURLSuffix, nFromIndex)) { + osl::File aZip(aZipURL); + if (aZip.open(OpenFlag_Read) == ::osl::FileBase::E_None) { + aZip.close(); + exists = true; + } + } + ++i; + } + m_checkStyleCache[style] = exists; + return exists; +} + bool ImplImageTree::loadImage( rtl::OUString const & name, rtl::OUString const & style, BitmapEx & bitmap, bool localized) { setStyle(style); - if (cacheLookup(name, localized, bitmap)) { + if (iconCacheLookup(name, localized, bitmap)) { return true; } if (!bitmap.IsEmpty()) { @@ -164,7 +196,7 @@ bool ImplImageTree::loadImage( rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr()); } if (found) { - m_cache[name.intern()] = std::make_pair(localized, bitmap); + m_iconCache[name.intern()] = std::make_pair(localized, bitmap); } return found; } @@ -173,7 +205,8 @@ void ImplImageTree::shutDown() { m_style = rtl::OUString(); // for safety; empty m_style means "not initialized" m_zips.clear(); - m_cache.clear(); + m_iconCache.clear(); + m_checkStyleCache.clear(); } void ImplImageTree::setStyle(rtl::OUString const & style) { @@ -181,7 +214,7 @@ void ImplImageTree::setStyle(rtl::OUString const & style) { if (style != m_style) { m_style = style; resetZips(); - m_cache.clear(); + m_iconCache.clear(); } } @@ -241,6 +274,7 @@ void ImplImageTree::resetZips() { u.GetMainURL(INetURLObject::NO_DECODE), css::uno::Reference< css::container::XNameAccess >())); } + if ( m_style.equals(::rtl::OUString::createFromAscii("default")) ) { rtl::OUString url( RTL_CONSTASCII_USTRINGPARAM( @@ -252,11 +286,23 @@ void ImplImageTree::resetZips() { } } -bool ImplImageTree::cacheLookup( +bool ImplImageTree::checkStyleCacheLookup( + rtl::OUString const & style, bool &exists) +{ + CheckStyleCache::iterator i(m_checkStyleCache.find(style)); + if (i != m_checkStyleCache.end()) { + exists = i->second; + return true; + } else { + return false; + } +} + +bool ImplImageTree::iconCacheLookup( rtl::OUString const & name, bool localized, BitmapEx & bitmap) { - Cache::iterator i(m_cache.find(name)); - if (i != m_cache.end() && i->second.first == localized) { + IconCache::iterator i(m_iconCache.find(name)); + if (i != m_iconCache.end() && i->second.first == localized) { bitmap = i->second.second; return true; } else { diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx index 5b543258cb0b..6298ff51a16a 100644 --- a/vcl/source/gdi/outdev.cxx +++ b/vcl/source/gdi/outdev.cxx @@ -1128,11 +1128,16 @@ namespace { inline int iround( float x ) { - sal_Int32 a = *reinterpret_cast<const sal_Int32 *>(&x); - sal_Int32 exponent = (127 + 31) - ((a >> 23) & 0xFF); - sal_Int32 r = ((sal_Int32(a) << 8) | (1U << 31)) >> exponent; + union + { + float f; + sal_Int32 i; + }; + f = x; + sal_Int32 exponent = (127 + 31) - ((i >> 23) & 0xFF); + sal_Int32 r = ((sal_Int32(i) << 8) | (1U << 31)) >> exponent; r &= ((exponent - 32) >> 31); - sal_Int32 sign = a >> 31; + sal_Int32 sign = i >> 31; return r = (r ^ sign) - sign; } diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index dd2f4a62c88d..d4bb54121f5b 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2847,6 +2847,121 @@ static bool getPfbSegmentLengths( const unsigned char* pFontBytes, int nByteLen, return true; } +std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitSystemFont( const ImplFontData* pFont, EmbedFont& rEmbed ) +{ + std::map< sal_Int32, sal_Int32 > aRet; + if( isBuiltinFont( pFont ) ) + { + aRet[ rEmbed.m_nNormalFontID ] = emitBuiltinFont( pFont ); + return aRet; + } + + sal_Int32 nFontObject = 0; + sal_Int32 nFontDescriptor = 0; + rtl::OString aSubType( "/Type1" ); + FontSubsetInfo aInfo; + // fill in dummy values + aInfo.m_nAscent = 1000; + aInfo.m_nDescent = 200; + aInfo.m_nCapHeight = 1000; + aInfo.m_aFontBBox = Rectangle( Point( -200, -200 ), Size( 1700, 1700 ) ); + aInfo.m_aPSName = pFont->maName; + sal_Int32 pWidths[256]; + rtl_zeroMemory( pWidths, sizeof(pWidths) ); + if( pFont->IsEmbeddable() ) + { + const unsigned char* pFontData = NULL; + long nFontLen = 0; + sal_Ucs nEncodedCodes[256]; + sal_Int32 pEncWidths[256]; + if( (pFontData = (const unsigned char*)m_pReferenceDevice->mpGraphics->GetEmbedFontData( pFont, nEncodedCodes, pEncWidths, aInfo, &nFontLen )) != NULL ) + { + m_pReferenceDevice->mpGraphics->FreeEmbedFontData( pFontData, nFontLen ); + for( int i = 0; i < 256; i++ ) + { + if( nEncodedCodes[i] >= 32 && nEncodedCodes[i] < 256 ) + { + pWidths[i] = pEncWidths[ i ]; + } + } + } + } + else if( pFont->mbSubsettable ) + { + aSubType = rtl::OString( "/TrueType" ); + Int32Vector aGlyphWidths; + Ucs2UIntMap aUnicodeMap; + m_pReferenceDevice->mpGraphics->GetGlyphWidths( pFont, false, aGlyphWidths, aUnicodeMap ); + + OUString aTmpName; + osl_createTempFile( NULL, NULL, &aTmpName.pData ); + sal_Int32 pGlyphIDs[ 256 ]; + sal_uInt8 pEncoding[ 256 ]; + sal_Ucs pUnicodes[ 256 ]; + sal_Int32 pDuWidths[ 256 ]; + + memset( pGlyphIDs, 0, sizeof( pGlyphIDs ) ); + memset( pEncoding, 0, sizeof( pEncoding ) ); + memset( pUnicodes, 0, sizeof( pUnicodes ) ); + memset( pDuWidths, 0, sizeof( pDuWidths ) ); + + for( sal_Ucs c = 32; c < 256; c++ ) + { + pUnicodes[c] = c; + pEncoding[c] = c; + pGlyphIDs[c] = 0; + if( aUnicodeMap.find( c ) != aUnicodeMap.end() ) + pWidths[ c ] = aGlyphWidths[ aUnicodeMap[ c ] ]; + } + + m_pReferenceDevice->mpGraphics->CreateFontSubset( aTmpName, pFont, pGlyphIDs, pEncoding, pDuWidths, 256, aInfo ); + osl_removeFile( aTmpName.pData ); + } + else + { + DBG_ERROR( "system font neither embeddable nor subsettable" ); + } + + // write font descriptor + nFontDescriptor = emitFontDescriptor( pFont, aInfo, 0, 0 ); + if( nFontDescriptor ) + { + // write font object + sal_Int32 nObject = createObject(); + if( updateObject( nObject ) ) + { + OStringBuffer aLine( 1024 ); + aLine.append( nObject ); + aLine.append( " 0 obj\n" + "<</Type/Font/Subtype" ); + aLine.append( aSubType ); + aLine.append( "/BaseFont/" ); + appendName( aInfo.m_aPSName, aLine ); + aLine.append( "\n" ); + if( !pFont->mbSymbolFlag ) + aLine.append( "/Encoding/WinAnsiEncoding\n" ); + aLine.append( "/FirstChar 32 /LastChar 255\n" + "/Widths[" ); + for( int i = 32; i < 256; i++ ) + { + aLine.append( pWidths[i] ); + aLine.append( ((i&15) == 15) ? "\n" : " " ); + } + aLine.append( "]\n" + "/FontDescriptor " ); + aLine.append( nFontDescriptor ); + aLine.append( " 0 R>>\n" + "endobj\n\n" ); + writeBuffer( aLine.getStr(), aLine.getLength() ); + + nFontObject = nObject; + aRet[ rEmbed.m_nNormalFontID ] = nObject; + } + } + + return aRet; +} + // TODO: always subset instead of embedding the full font => this method becomes obsolete then std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFontData* pFont, EmbedFont& rEmbed ) { @@ -3606,24 +3721,28 @@ sal_Int32 PDFWriterImpl::emitFontDescriptor( const ImplFontData* pFont, FontSubs // According to PDF reference 1.4 StemV is required // seems a tad strange to me, but well ... aLine.append( "\n" - "/StemV 80\n" - "/FontFile" ); - switch( rInfo.m_nFontType ) + "/StemV 80\n" ); + if( nFontStream ) { - case FontSubsetInfo::SFNT_TTF: - aLine.append( '2' ); - break; - case FontSubsetInfo::TYPE1_PFA: - case FontSubsetInfo::TYPE1_PFB: - case FontSubsetInfo::ANY_TYPE1: - break; - default: - DBG_ERROR( "unknown fonttype in PDF font descriptor" ); - return 0; + aLine.append( "/FontFile" ); + switch( rInfo.m_nFontType ) + { + case FontSubsetInfo::SFNT_TTF: + aLine.append( '2' ); + break; + case FontSubsetInfo::TYPE1_PFA: + case FontSubsetInfo::TYPE1_PFB: + case FontSubsetInfo::ANY_TYPE1: + break; + default: + DBG_ERROR( "unknown fonttype in PDF font descriptor" ); + return 0; + } + aLine.append( ' ' ); + aLine.append( nFontStream ); + aLine.append( " 0 R\n" ); } - aLine.append( ' ' ); - aLine.append( nFontStream ); - aLine.append( " 0 R>>\n" + aLine.append( ">>\n" "endobj\n\n" ); CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) ); @@ -3880,6 +3999,17 @@ bool PDFWriterImpl::emitFonts() } } + // emit system fonts + for( FontEmbedData::iterator sit = m_aSystemFonts.begin(); sit != m_aSystemFonts.end(); ++sit ) + { + std::map< sal_Int32, sal_Int32 > aObjects = emitSystemFont( sit->first, sit->second ); + for( std::map< sal_Int32, sal_Int32 >::iterator fit = aObjects.begin(); fit != aObjects.end(); ++fit ) + { + CHECK_RETURN( fit->second ); + aFontIDToObject[ fit->first ] = fit->second; + } + } + OStringBuffer aFontDict( 1024 ); aFontDict.append( getFontDictObject() ); aFontDict.append( " 0 obj\n" @@ -4580,13 +4710,25 @@ void PDFWriterImpl::createDefaultEditAppearance( PDFWidget& rEdit, const PDFWrit // prepare font to use, draw field border Font aFont = drawFieldBorder( rEdit, rWidget, rSettings ); - sal_Int32 nBest = getBestBuiltinFont( aFont ); + sal_Int32 nBest = m_aContext.FieldsUseSystemFonts ? getSystemFont( aFont ): getBestBuiltinFont( aFont ); // prepare DA string OStringBuffer aDA( 32 ); appendNonStrokingColor( replaceColor( rWidget.TextColor, rSettings.GetFieldTextColor() ), aDA ); aDA.append( ' ' ); - aDA.append( m_aBuiltinFonts[nBest].getNameObject() ); + if( m_aContext.FieldsUseSystemFonts ) + { + aDA.append( "/F" ); + aDA.append( nBest ); + + OStringBuffer aDR( 32 ); + aDR.append( "/Font " ); + aDR.append( getFontDictObject() ); + aDR.append( " 0 R" ); + rEdit.m_aDRDict = aDR.makeStringAndClear(); + } + else + aDA.append( m_aBuiltinFonts[nBest].getNameObject() ); aDA.append( ' ' ); m_aPages[ m_nCurrentPage ].appendMappedLength( sal_Int32( aFont.GetHeight() ), aDA ); aDA.append( " Tf" ); @@ -4620,7 +4762,7 @@ void PDFWriterImpl::createDefaultListBoxAppearance( PDFWidget& rBox, const PDFWr // prepare font to use, draw field border Font aFont = drawFieldBorder( rBox, rWidget, rSettings ); - sal_Int32 nBest = getBestBuiltinFont( aFont ); + sal_Int32 nBest = m_aContext.FieldsUseSystemFonts ? getSystemFont( aFont ): getBestBuiltinFont( aFont ); beginRedirect( pListBoxStream, rBox.m_aRect ); OStringBuffer aAppearance( 64 ); @@ -4668,9 +4810,22 @@ void PDFWriterImpl::createDefaultListBoxAppearance( PDFWidget& rBox, const PDFWr aDA.append( " 2 Tr " ); } #endif + // prepare DA string appendNonStrokingColor( replaceColor( rWidget.TextColor, rSettings.GetFieldTextColor() ), aDA ); aDA.append( ' ' ); - aDA.append( m_aBuiltinFonts[nBest].getNameObject() ); + if( m_aContext.FieldsUseSystemFonts ) + { + aDA.append( "/F" ); + aDA.append( nBest ); + + OStringBuffer aDR( 32 ); + aDR.append( "/Font " ); + aDR.append( getFontDictObject() ); + aDR.append( " 0 R" ); + rBox.m_aDRDict = aDR.makeStringAndClear(); + } + else + aDA.append( m_aBuiltinFonts[nBest].getNameObject() ); aDA.append( ' ' ); m_aPages[ m_nCurrentPage ].appendMappedLength( sal_Int32( aFont.GetHeight() ), aDA ); aDA.append( " Tf" ); @@ -5247,9 +5402,18 @@ bool PDFWriterImpl::emitWidgetAnnotations() } if( rWidget.m_aDAString.getLength() ) { - aLine.append( "/DR<</Font<<" ); - appendBuiltinFontsToDict( aLine ); - aLine.append( ">>>>\n" ); + if( rWidget.m_aDRDict.getLength() ) + { + aLine.append( "/DR<<" ); + aLine.append( rWidget.m_aDRDict ); + aLine.append( ">>\n" ); + } + else + { + aLine.append( "/DR<</Font<<" ); + appendBuiltinFontsToDict( aLine ); + aLine.append( ">>>>\n" ); + } aLine.append( "/DA" ); appendLiteralStringEncrypt( rWidget.m_aDAString, rWidget.m_nObject, aLine ); aLine.append( "\n" ); @@ -6390,6 +6554,29 @@ std::set< PDFWriter::ErrorCode > PDFWriterImpl::getErrors() return m_aErrors; } +sal_Int32 PDFWriterImpl::getSystemFont( const Font& i_rFont ) +{ + getReferenceDevice()->Push(); + getReferenceDevice()->SetFont( i_rFont ); + getReferenceDevice()->ImplNewFont(); + + const ImplFontData* pDevFont = m_pReferenceDevice->mpFontEntry->maFontSelData.mpFontData; + sal_Int32 nFontID = 0; + FontEmbedData::iterator it = m_aSystemFonts.find( pDevFont ); + if( it != m_aSystemFonts.end() ) + nFontID = it->second.m_nNormalFontID; + else + { + nFontID = m_nNextFID++; + m_aSystemFonts[ pDevFont ] = EmbedFont(); + m_aSystemFonts[ pDevFont ].m_nNormalFontID = nFontID; + } + + getReferenceDevice()->Pop(); + getReferenceDevice()->ImplNewFont(); + + return nFontID; +} void PDFWriterImpl::registerGlyphs( int nGlyphs, sal_GlyphId* pGlyphs, diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx index 7d5ec2bf4f61..4a7f8ab0e33a 100644 --- a/vcl/source/gdi/pdfwriter_impl.hxx +++ b/vcl/source/gdi/pdfwriter_impl.hxx @@ -311,6 +311,8 @@ public: { sal_Int32 m_nNormalFontID; std::list< EmbedEncoding > m_aExtendedEncodings; + + EmbedFont() : m_nNormalFontID( 0 ) {} }; typedef std::map< const ImplFontData*, EmbedFont > FontEmbedData; @@ -396,6 +398,7 @@ public: USHORT m_nTextStyle; rtl::OUString m_aValue; rtl::OString m_aDAString; + rtl::OString m_aDRDict; rtl::OString m_aMKDict; rtl::OString m_aMKDictCAString; // i12626, added to be able to encrypt the /CA text string // since the object number is not known at the moment @@ -612,6 +615,7 @@ private: FontSubsetData m_aSubsets; bool m_bEmbedStandardFonts; FontEmbedData m_aEmbeddedFonts; + FontEmbedData m_aSystemFonts; sal_Int32 m_nNextFID; PDFFontCache m_aFontCache; @@ -897,6 +901,8 @@ i12626 sal_Int32 emitBuiltinFont( const ImplFontData*, sal_Int32 nObject = -1 ); /* writes a type1 embedded font object and returns its mapping from font ids to object ids (or 0 in case of failure ) */ std::map< sal_Int32, sal_Int32 > emitEmbeddedFont( const ImplFontData*, EmbedFont& ); + /* writes a type1 system font object and returns its mapping from font ids to object ids (or 0 in case of failure ) */ + std::map< sal_Int32, sal_Int32 > emitSystemFont( const ImplFontData*, EmbedFont& ); /* writes a font descriptor and returns its object id (or 0) */ sal_Int32 emitFontDescriptor( const ImplFontData*, FontSubsetInfo&, sal_Int32 nSubsetID, sal_Int32 nStream ); /* writes a ToUnicode cmap, returns the corresponding stream object */ @@ -983,6 +989,7 @@ i12626 sal_Int32 findRadioGroupWidget( const PDFWriter::RadioButtonWidget& rRadio ); Font replaceFont( const Font& rControlFont, const Font& rAppSetFont ); sal_Int32 getBestBuiltinFont( const Font& rFont ); + sal_Int32 getSystemFont( const Font& i_rFont ); // used for edit and listbox Font drawFieldBorder( PDFWidget&, const PDFWriter::AnyWidget&, const StyleSettings& ); diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx index 5314837143de..66865759db4b 100644 --- a/vcl/source/gdi/region.cxx +++ b/vcl/source/gdi/region.cxx @@ -2459,6 +2459,14 @@ SvStream& operator>>( SvStream& rIStrm, Region& rRegion ) } } + if( rIStrm.IsEof() ) + { + DBG_ERROR( "premature end of region stream" ); + delete rRegion.mpImplRegion; + rRegion.mpImplRegion = (ImplRegion*)&aImplEmptyRegion; + return rIStrm; + } + // get next header rIStrm >> nTmp16; } diff --git a/vcl/source/window/accmgr.cxx b/vcl/source/window/accmgr.cxx index 71373bbabee5..36064fc8bc6b 100644 --- a/vcl/source/window/accmgr.cxx +++ b/vcl/source/window/accmgr.cxx @@ -83,6 +83,23 @@ void ImplAccelManager::RemoveAccel( Accelerator* pAccel ) if ( !mpAccelList ) return; + //e.g. #i90599#. Someone starts typing a sequence in a dialog, but doesn't + //end it, and then closes the dialog, deleting the accelerators. So if + //we're removing an accelerator that a sub-accelerator which is in the + //sequence list, throw away the entire sequence + if ( mpSequenceList ) + { + for (USHORT i = 0; i < pAccel->GetItemCount(); ++i) + { + Accelerator* pSubAccel = pAccel->GetAccel(pAccel->GetItemId(i)); + if ( mpSequenceList->GetPos( pSubAccel ) != LIST_ENTRY_NOTFOUND ) + { + EndSequence( true ); + break; + } + } + } + // Raus damit mpAccelList->Remove( pAccel ); } diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 1fc2b9be703a..997e63d8b22e 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -453,6 +453,14 @@ Dialog::~Dialog() // ----------------------------------------------------------------------- +IMPL_LINK( Dialog, ImplAsyncCloseHdl, void*, EMPTYARG ) +{ + Close(); + return 0; +} + +// ----------------------------------------------------------------------- + long Dialog::Notify( NotifyEvent& rNEvt ) { // Zuerst Basisklasse rufen wegen TabSteuerung @@ -468,7 +476,11 @@ long Dialog::Notify( NotifyEvent& rNEvt ) if ( (nKeyCode == KEY_ESCAPE) && ((GetStyle() & WB_CLOSEABLE) || ImplGetCancelButton( this ) || ImplGetOKButton( this )) ) { - Close(); + // #i89505# for the benefit of slightly mentally challenged implementations + // like e.g. SfxModelessDialog which destroy themselves inside Close() + // post this Close asynchronous so we can leave our key handler before + // we get destroyed + PostUserEvent( LINK( this, Dialog, ImplAsyncCloseHdl ), this ); return TRUE; } } diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index f3ce8b2d05ea..2d99fbb20b65 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -62,6 +62,7 @@ public: TaskPaneList* mpTaskPaneList; Size maMaxOutSize; + rtl::OUString maRepresentedURL; }; SystemWindow::ImplData::ImplData() @@ -277,6 +278,29 @@ void SystemWindow::SetZLevel( BYTE nLevel ) // ----------------------------------------------------------------------- +void SystemWindow::SetRepresentedURL( const rtl::OUString& i_rURL ) +{ + bool bChanged = (i_rURL != mpImplData->maRepresentedURL); + mpImplData->maRepresentedURL = i_rURL; + if ( !mbSysChild && bChanged ) + { + const Window* pWindow = this; + while ( pWindow->mpWindowImpl->mpBorderWindow ) + pWindow = pWindow->mpWindowImpl->mpBorderWindow; + + if ( pWindow->mpWindowImpl->mbFrame ) + pWindow->mpWindowImpl->mpFrame->SetRepresentedURL( i_rURL ); + } +} +// ----------------------------------------------------------------------- + +const rtl::OUString& SystemWindow::GetRepresentedURL() const +{ + return mpImplData->maRepresentedURL; +} + +// ----------------------------------------------------------------------- + void SystemWindow::SetIcon( USHORT nIcon ) { if ( mnIcon == nIcon ) diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index 9ec86fab20de..ecc335420f18 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -1002,6 +1002,9 @@ const Size& ToolBox::GetDefaultImageSize() const case STYLE_SYMBOLS_CRYSTAL: aLargeButtonSize = Size( TB_LARGEIMAGESIZE_CRYSTAL, TB_LARGEIMAGESIZE_CRYSTAL ); break; + case STYLE_SYMBOLS_OXYGEN: + aLargeButtonSize = Size( TB_LARGEIMAGESIZE_OXYGEN, TB_LARGEIMAGESIZE_OXYGEN ); + break; default: aLargeButtonSize = Size( TB_LARGEIMAGESIZE, TB_LARGEIMAGESIZE ); } |