[Libreoffice-commits] .: svtools/inc svtools/source vcl/source vcl/win

Joseph Powers jpowers at kemper.freedesktop.org
Mon Nov 22 18:58:22 PST 2010


 svtools/inc/svtools/embedhlp.hxx   |    9 +--
 svtools/source/misc/embedhlp.cxx   |  104 -------------------------------------
 vcl/source/window/toolbox2.cxx     |    8 +-
 vcl/source/window/window.cxx       |   31 +++++------
 vcl/win/source/window/salframe.cxx |   25 ++++----
 5 files changed, 37 insertions(+), 140 deletions(-)

New commits:
commit 35b033d1ce2dca15461bc4d6a17f977ad66bc59e
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Mon Nov 22 18:57:39 2010 -0800

    Remove last of the HC icons from libs-gui
    
    Auto HC detection will set the icons to the HC set; since we no longer have
    HC icons in the normal sets.

diff --git a/svtools/inc/svtools/embedhlp.hxx b/svtools/inc/svtools/embedhlp.hxx
index 2e15a73..3f857e0 100644
--- a/svtools/inc/svtools/embedhlp.hxx
+++ b/svtools/inc/svtools/embedhlp.hxx
@@ -2,7 +2,7 @@
 /*************************************************************************
  *
  * 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
@@ -110,9 +110,6 @@ namespace svt
         // no conversion is done if no target mode is provided
         Size			GetSize( MapMode* pTargetMapMode = NULL ) const;
 
-        // the following method tries to get the HC graphic if it is possible, otherwise returns NULL
-        Graphic*        GetHCGraphic() const;
-
         void            SetGraphic( const Graphic& rGraphic, const ::rtl::OUString& rMediaType );
         void			SetGraphicStream(
                             const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInGrStream,
@@ -130,8 +127,8 @@ namespace svt
 
         // #i104867#
         // Provides a graphic version number for the fetchable Graphic during this object's lifetime. Internally,
-        // that number is incremented at each change of the Graphic. This mechanism is needed to identify if a 
-        // remembered Graphic (e.g. primitives) has changed compared to the current one, but without actively 
+        // that number is incremented at each change of the Graphic. This mechanism is needed to identify if a
+        // remembered Graphic (e.g. primitives) has changed compared to the current one, but without actively
         // fetching the Graphic what would be too expensive e.g. for charts
         sal_uInt32 getGraphicVersion() const;
         void            SetDefaultSizeForChart( const Size& rSizeIn_100TH_MM );//#i103460# charts do not necessaryly have an own size within ODF files, in this case they need to use the size settings from the surrounding frame, which is made available with this method
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index 69f130a..9ca8175 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -2,7 +2,7 @@
 /*************************************************************************
  *
  * 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
@@ -235,7 +235,6 @@ struct EmbeddedObjectRef_Impl
     ::rtl::OUString                             aMediaType;
     comphelper::EmbeddedObjectContainer*        pContainer;
     Graphic*                                    pGraphic;
-    Graphic*                                    pHCGraphic;
     sal_Int64                                   nViewAspect;
     BOOL                                        bIsLocked;
     sal_Bool                                    bNeedUpdate;
@@ -250,7 +249,6 @@ void EmbeddedObjectRef::Construct_Impl()
     mpImp = new EmbeddedObjectRef_Impl;
     mpImp->pContainer = 0;
     mpImp->pGraphic = 0;
-    mpImp->pHCGraphic = 0;
     mpImp->nViewAspect = embed::Aspects::MSOLE_CONTENT;
     mpImp->bIsLocked = FALSE;
     mpImp->bNeedUpdate = sal_False;
@@ -289,42 +287,15 @@ EmbeddedObjectRef::EmbeddedObjectRef( const EmbeddedObjectRef& rObj )
     else
         mpImp->pGraphic = 0;
 
-    mpImp->pHCGraphic = 0;
     mpImp->mnGraphicVersion = 0;
 }
 
 EmbeddedObjectRef::~EmbeddedObjectRef()
 {
     delete mpImp->pGraphic;
-    if ( mpImp->pHCGraphic ) 
-        DELETEZ( mpImp->pHCGraphic );
     Clear();
 }
-/*
-EmbeddedObjectRef& EmbeddedObjectRef::operator = ( const EmbeddedObjectRef& rObj )
-{
-    DBG_ASSERT( !mxObj.is(), "Never assign an already assigned object!" );
-
-    delete mpImp->pGraphic;
-    if ( mpImp->pHCGraphic ) DELETEZ( mpImp->pHCGraphic );
-    Clear();
 
-    mpImp->nViewAspect = rObj.mpImp->nViewAspect;
-    mpImp->bIsLocked = rObj.mpImp->bIsLocked;
-    mxObj = rObj.mxObj;
-    mpImp->xListener = EmbedEventListener_Impl::Create( this );
-    mpImp->pContainer = rObj.mpImp->pContainer;
-    mpImp->aPersistName = rObj.mpImp->aPersistName;
-    mpImp->aMediaType = rObj.mpImp->aMediaType;
-    mpImp->bNeedUpdate = rObj.mpImp->bNeedUpdate;
-
-    if ( rObj.mpImp->pGraphic && !rObj.mpImp->bNeedUpdate )
-        mpImp->pGraphic = new Graphic( *rObj.mpImp->pGraphic );
-    else
-        mpImp->pGraphic = 0;
-    return *this;
-}
-*/
 void EmbeddedObjectRef::Assign( const NS_UNO::Reference < NS_EMBED::XEmbeddedObject >& xObj, sal_Int64 nAspect )
 {
     DBG_ASSERT( !mxObj.is(), "Never assign an already assigned object!" );
@@ -448,8 +419,6 @@ void EmbeddedObjectRef::GetReplacement( BOOL bUpdate )
         DELETEZ( mpImp->pGraphic );
         mpImp->aMediaType = ::rtl::OUString();
         mpImp->pGraphic = new Graphic;
-        if ( mpImp->pHCGraphic ) 
-            DELETEZ( mpImp->pHCGraphic );
         mpImp->mnGraphicVersion++;
     }
     else if ( !mpImp->pGraphic )
@@ -546,69 +515,6 @@ Size EmbeddedObjectRef::GetSize( MapMode* pTargetMapMode ) const
     return aResult;
 }
 
-Graphic* EmbeddedObjectRef::GetHCGraphic() const
-{
-    if ( !mpImp->pHCGraphic )
-    {
-        uno::Reference< io::XInputStream > xInStream;
-        try
-        {
-            // if the object needs size on load, that means that it is not our object
-            // currently the HC mode is supported only for OOo own objects so the following
-            // check is used as an optimization
-            // TODO/LATER: shouldn't there be a special status flag to detect alien implementation?
-            if ( mpImp->nViewAspect == embed::Aspects::MSOLE_CONTENT
-              && mxObj.is() && !( mxObj->getStatus( mpImp->nViewAspect ) & embed::EmbedMisc::EMBED_NEEDSSIZEONLOAD ) )
-            {
-                // TODO/LATER: optimization, it makes no sence to do it for OLE objects
-                if ( mxObj->getCurrentState() == embed::EmbedStates::LOADED )
-                    mxObj->changeState( embed::EmbedStates::RUNNING );
-
-                // TODO: return for the aspect of the document
-                embed::VisualRepresentation aVisualRepresentation;
-                uno::Reference< datatransfer::XTransferable > xTransferable( mxObj->getComponent(), uno::UNO_QUERY );
-                if ( !xTransferable.is() )
-                    throw uno::RuntimeException();
-
-                datatransfer::DataFlavor aDataFlavor(
-                        ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"" )),
-                        ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "GDIMetaFile" )),
-                        ::getCppuType( (const uno::Sequence< sal_Int8 >*) NULL ) );
-
-                uno::Sequence < sal_Int8 > aSeq;
-                if ( ( xTransferable->getTransferData( aDataFlavor ) >>= aSeq ) && aSeq.getLength() )
-                    xInStream = new ::comphelper::SequenceInputStream( aSeq );
-            }
-        }
-        catch ( uno::Exception& )
-        {
-        }
-
-        if ( xInStream.is() )
-        {
-            SvStream* pStream = NULL;
-            pStream = ::utl::UcbStreamHelper::CreateStream( xInStream );
-            if ( pStream )
-            {
-                if ( !pStream->GetError() )
-                {
-                    GraphicFilter* pGF = GraphicFilter::GetGraphicFilter();
-                    Graphic* pGraphic = new Graphic(); 
-                    if ( pGF->ImportGraphic( *pGraphic, String(), *pStream, GRFILTER_FORMAT_DONTKNOW ) == 0 )
-                        mpImp->pHCGraphic = pGraphic;
-                    else
-                        delete pGraphic;
-                    mpImp->mnGraphicVersion++;
-                }
-
-                delete pStream;
-            }
-        }
-    }
-
-    return mpImp->pHCGraphic;
-}
-
 void EmbeddedObjectRef::SetGraphicStream( const uno::Reference< io::XInputStream >& xInGrStream,
                                             const ::rtl::OUString& rMediaType )
 {
@@ -616,8 +522,6 @@ void EmbeddedObjectRef::SetGraphicStream( const uno::Reference< io::XInputStream
         delete mpImp->pGraphic;
     mpImp->pGraphic = new Graphic();
     mpImp->aMediaType = rMediaType;
-    if ( mpImp->pHCGraphic ) 
-        DELETEZ( mpImp->pHCGraphic );
     mpImp->mnGraphicVersion++;
 
     SvStream* pGraphicStream = ::utl::UcbStreamHelper::CreateStream( xInGrStream );
@@ -627,7 +531,7 @@ void EmbeddedObjectRef::SetGraphicStream( const uno::Reference< io::XInputStream
         GraphicFilter* pGF = GraphicFilter::GetGraphicFilter();
         pGF->ImportGraphic( *mpImp->pGraphic, String(), *pGraphicStream, GRFILTER_FORMAT_DONTKNOW );
         mpImp->mnGraphicVersion++;
-    
+
         if ( mpImp->pContainer )
         {
             pGraphicStream->Seek( 0 );
@@ -649,8 +553,6 @@ void EmbeddedObjectRef::SetGraphic( const Graphic& rGraphic, const ::rtl::OUStri
         delete mpImp->pGraphic;
     mpImp->pGraphic = new Graphic( rGraphic );
     mpImp->aMediaType = rMediaType;
-    if ( mpImp->pHCGraphic ) 
-        DELETEZ( mpImp->pHCGraphic );
     mpImp->mnGraphicVersion++;
 
     if ( mpImp->pContainer )
@@ -886,8 +788,6 @@ void EmbeddedObjectRef::UpdateReplacementOnDemand()
 {
     DELETEZ( mpImp->pGraphic );
     mpImp->bNeedUpdate = sal_True;
-    if ( mpImp->pHCGraphic ) 
-        DELETEZ( mpImp->pHCGraphic );
     mpImp->mnGraphicVersion++;
 
     if( mpImp->pContainer )
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index dcabb5c..0132ee2 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -2,7 +2,7 @@
 /*************************************************************************
  *
  * 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
@@ -2412,17 +2412,15 @@ void ToolBox::ImplUpdateImageList()
 {
     if (mpData->mpImageListProvider != NULL)
     {
-        BOOL bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
         try
         {
-            ImageListType eType = bHC ? vcl::HIGHCONTRAST_YES : vcl::HIGHCONTRAST_NO;
-
+            ImageListType eType = vcl::HIGHCONTRAST_NO;
             if (eType != mpData->meImageListType)
             {
                 vcl::IImageListProvider* pImageListProvider = mpData->mpImageListProvider;
                 SetImageList( pImageListProvider->getImageList(eType) );
                 mpData->meImageListType = eType;
-            }            
+            }
         }
         catch (com::sun::star::lang::IllegalArgumentException &) {}
     }
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index fc49ec3..1ecd97d 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2,7 +2,7 @@
 /*************************************************************************
  *
  * 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
@@ -286,8 +286,6 @@ bool Window::ImplCheckUIFont( const Font& rFont )
 
 void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl )
 {
-    // reset high contrast to false, so the system can either update it
-    // or AutoDetectSystemHC can kick in (see below)
     StyleSettings aTmpSt( rSettings.GetStyleSettings() );
     aTmpSt.SetHighContrastMode( FALSE );
     rSettings.SetStyleSettings( aTmpSt );
@@ -471,7 +469,6 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl )
 
     rSettings.SetStyleSettings( aStyleSettings );
 
-
     // auto detect HC mode; if the system already set it to "yes"
     // (see above) then accept that
     if( !rSettings.GetStyleSettings().GetHighContrastMode() )
@@ -493,15 +490,17 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl )
             {
                 aStyleSettings = rSettings.GetStyleSettings();
                 aStyleSettings.SetHighContrastMode( TRUE );
+                aStyleSettings.SetSymbolsStyle( STYLE_SYMBOLS_HICONTRAST );
                 rSettings.SetStyleSettings( aStyleSettings );
             }
         }
     }
-    
+
     static const char* pEnvHC = getenv( "SAL_FORCE_HC" );
     if( pEnvHC && *pEnvHC )
     {
         aStyleSettings.SetHighContrastMode( TRUE );
+        aStyleSettings.SetSymbolsStyle( STYLE_SYMBOLS_HICONTRAST );
         rSettings.SetStyleSettings( aStyleSettings );
     }
 
@@ -719,7 +718,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
 
     ImplSVData* pSVData = ImplGetSVData();
     Window*     pRealParent = pParent;
-    
+
     // 3D-Look vererben
     if ( !mpWindowImpl->mbOverlapWin && pParent && (pParent->GetStyle() & WB_3DLOOK) )
         nStyle |= WB_3DLOOK;
@@ -2337,7 +2336,7 @@ void Window::ImplCallPaint( const Region* pRegion, USHORT nPaintFlags )
     // call PrePaint. PrePaint may add to the invalidate region as well as
     // other parameters used below.
     PrePaint();
-    
+
     mpWindowImpl->mbPaintFrame = FALSE;
 
     if ( nPaintFlags & IMPL_PAINT_PAINTALLCHILDS )
@@ -3278,7 +3277,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
                 nX = mpWindowImpl->mpParent->mnOutWidth - mnOutWidth - nX;
             }
         }
-        
+
         // check maPos as well, as it could have been changed for client windows (ImplCallMove())
         if ( mpWindowImpl->mnAbsScreenX != aPtDev.X() || nX != mpWindowImpl->mnX || nOrgX != mpWindowImpl->maPos.X() )
         {
@@ -9359,7 +9358,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect,
 {
     if( rRect.IsEmpty() )
         return;
-    
+
     bool bRoundEdges = nCornerRadius > 0;
 
     const StyleSettings& rStyles = GetSettings().GetStyleSettings();
@@ -9838,7 +9837,7 @@ void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rP
     // preserve graphicsstate
     Push();
     Region aClipRegion( GetClipRegion() );
-    SetClipRegion();    
+    SetClipRegion();
 
     GDIMetaFile* pOldMtf = GetConnectMetaFile();
     GDIMetaFile aMtf;
@@ -9900,7 +9899,7 @@ void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rP
     SetConnectMetaFile( pOldMtf );
     EnableOutput( bOutput );
     mpWindowImpl->mbReallyVisible = bRVisible;
-    
+
     // paint metafile to VDev
     VirtualDevice* pMaskedDevice = new VirtualDevice( *i_pTargetOutDev, 0, 0 );
     pMaskedDevice->SetOutputSizePixel( GetOutputSizePixel() );
@@ -9922,7 +9921,7 @@ void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rP
                 nDeltaX = mnOutWidth - nDeltaX - pChild->mnOutWidth;
             long nDeltaY = pChild->GetOutOffYPixel() - GetOutOffYPixel();
             Point aPos( i_rPos );
-            Point aDelta( nDeltaX, nDeltaY );                
+            Point aDelta( nDeltaX, nDeltaY );
             aPos += aDelta;
             pChild->ImplPaintToDevice( i_pTargetOutDev, aPos );
         }
@@ -9941,11 +9940,11 @@ void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rP
 void Window::PaintToDevice( OutputDevice* pDev, const Point& rPos, const Size& /*rSize*/ )
 {
     // FIXME: scaling: currently this is for pixel copying only
-    
+
     DBG_ASSERT( ! pDev->ImplHasMirroredGraphics(), "PaintToDevice to mirroring graphics" );
     DBG_ASSERT( ! pDev->IsRTLEnabled(), "PaintToDevice to mirroring device" );
-    
-    
+
+
     Point       aPos  = pDev->LogicToPixel( rPos );
 
     Window* pRealParent = NULL;
@@ -9963,7 +9962,7 @@ void Window::PaintToDevice( OutputDevice* pDev, const Point& rPos, const Size& /
 
     BOOL bVisible = mpWindowImpl->mbVisible;
     mpWindowImpl->mbVisible = TRUE;
-    
+
     if( mpWindowImpl->mpBorderWindow )
         mpWindowImpl->mpBorderWindow->ImplPaintToDevice( pDev, rPos );
     else
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index 46a825b..76e4dd9 100644
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -2,7 +2,7 @@
 /*************************************************************************
  *
  * 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
@@ -388,7 +388,7 @@ SalFrame* ImplSalCreateFrame( WinSalInstance* pInst,
         // this breaks SAL_FRAME_STYLE_SYSTEMCHILD handling, which is not
         // used currently. Probably SAL_FRAME_STYLE_SYSTEMCHILD should be
         // removed again.
-        
+
         // nSysStyle  |= WS_CLIPCHILDREN;
         if ( hWndParent )
         {
@@ -2179,7 +2179,7 @@ static void ImplSalToTop( HWND hWnd, USHORT nFlags )
     WinSalFrame* pToTopFrame = GetWindowPtr( hWnd );
     if( pToTopFrame && (pToTopFrame->mnStyle & SAL_FRAME_STYLE_SYSTEMCHILD) != 0 )
         BringWindowToTop( hWnd );
-    
+
     if ( nFlags & SAL_FRAME_TOTOP_FOREGROUNDTASK )
     {
         // This magic code is necessary to connect the input focus of the
@@ -3009,11 +3009,14 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
     // High contrast
     HIGHCONTRAST hc;
     hc.cbSize = sizeof( HIGHCONTRAST );
-    if( SystemParametersInfo( SPI_GETHIGHCONTRAST, hc.cbSize, &hc, 0) && (hc.dwFlags & HCF_HIGHCONTRASTON) )
+    if(    SystemParametersInfo( SPI_GETHIGHCONTRAST, hc.cbSize, &hc, 0)
+        && (hc.dwFlags & HCF_HIGHCONTRASTON)
+    ) {
         aStyleSettings.SetHighContrastMode( 1 );
-    else
+        aStyleSettings.SetSymbolsStyle( STYLE_SYMBOLS_HICONTRAST );
+    } else {
         aStyleSettings.SetHighContrastMode( 0 );
-
+    }
 
     // Query Fonts
     Font    aMenuFont = aStyleSettings.GetMenuFont();
@@ -4035,14 +4038,14 @@ static long ImplHandleKeyMsg( HWND hWnd, UINT nMsg,
                 aKeyEvt.mnTime      = GetMessageTime();
                 aKeyEvt.mnCode     |= nModCode;
                 aKeyEvt.mnRepeat    = nRepeat;
-                
+
                 if( (nModCode & (KEY_MOD1|KEY_MOD2)) == (KEY_MOD1|KEY_MOD2) &&
                     aKeyEvt.mnCharCode )
                 {
                      // this is actually AltGr and should not be handled as Alt
                      aKeyEvt.mnCode &= ~(KEY_MOD1|KEY_MOD2);
                 }
-                
+
                 bIgnoreCharMsg = bCharPeek ? TRUE : FALSE;
                 long nRet = pFrame->CallCallback( nEvent, &aKeyEvt );
                 // independent part only reacts on keyup but Windows does not send
@@ -5802,10 +5805,10 @@ static LRESULT ImplHandleIMEReconvertString( HWND hWnd, LPARAM lParam )
     {
     // The first call for reconversion.
     pFrame->CallCallback( SALEVENT_STARTRECONVERSION, (void*)NULL );
-    
+
     // Retrieve the surrounding text from the focused control.
     pFrame->CallCallback( SALEVENT_SURROUNDINGTEXTREQUEST, (void*)&aEvt );
-    
+
     if( aEvt.maText.Len() == 0 )
     {
         return 0;
@@ -6282,7 +6285,7 @@ LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lP
             break;
         case WM_APPCOMMAND:
             if( ImplHandleAppCommand( hWnd, lParam ) )
-            {                
+            {
                 rDef = false;
                 nRet = 1;
             }


More information about the Libreoffice-commits mailing list