summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsb <sb@openoffice.org>2009-09-16 17:08:52 +0200
committersb <sb@openoffice.org>2009-09-16 17:08:52 +0200
commitc763ddce153dbb73707680874ef9d2f011caaeeb (patch)
tree75e54d51e845aca81d12e1b0fdbbc98ae74e56d2
parent5c0d7cef63d359c8a23fcff9a2e6c4f1f37878b8 (diff)
parent9312cb4741bf45017a1394faf587aa13f5172cc1 (diff)
merged in DEV300_m59
-rw-r--r--i18npool/source/breakiterator/breakiteratorImpl.cxx9
-rw-r--r--rsc/source/parser/rscicpx.cxx4
-rw-r--r--sax/source/expatwrap/saxwriter.cxx4
-rw-r--r--svtools/inc/dialogcontrolling.hxx38
-rw-r--r--svtools/inc/svtools/embedhlp.hxx1
-rw-r--r--svtools/source/brwbox/brwbox1.cxx2
-rw-r--r--svtools/source/dialogs/wizdlg.cxx5
-rw-r--r--svtools/source/misc/dialogcontrolling.cxx27
-rw-r--r--svtools/source/misc/embedhlp.cxx26
-rw-r--r--toolkit/inc/toolkit/helper/vclunohelper.hxx16
-rw-r--r--toolkit/source/awt/vclxwindow.cxx76
-rw-r--r--toolkit/source/helper/vclunohelper.cxx55
-rw-r--r--tools/inc/tools/rc.h1
-rw-r--r--tools/source/fsys/urlobj.cxx2
-rw-r--r--vcl/source/app/svapp.cxx4
-rw-r--r--vcl/source/control/button.cxx13
-rw-r--r--vcl/source/control/field.cxx3
-rw-r--r--vcl/source/control/fixed.cxx14
-rw-r--r--vcl/source/control/ilstbox.cxx17
-rw-r--r--vcl/source/control/imgctrl.cxx8
-rw-r--r--vcl/source/fontsubset/fontsubset.cxx2
-rw-r--r--vcl/source/gdi/outdev3.cxx45
-rw-r--r--vcl/source/gdi/wall.cxx2
-rw-r--r--vcl/source/glyphs/graphite_adaptors.cxx2
-rw-r--r--vcl/source/glyphs/graphite_cache.cxx2
-rw-r--r--vcl/source/glyphs/graphite_features.cxx2
-rw-r--r--vcl/source/glyphs/graphite_layout.cxx6
-rw-r--r--vcl/source/glyphs/graphite_serverfont.cxx2
-rw-r--r--vcl/source/window/menu.cxx14
-rw-r--r--vcl/source/window/msgbox.cxx6
-rw-r--r--vcl/source/window/toolbox.cxx2
-rw-r--r--vcl/source/window/toolbox2.cxx4
-rw-r--r--vcl/source/window/window.cxx12
-rw-r--r--vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx7
-rw-r--r--vcl/unx/gtk/window/gtkframe.cxx2
-rw-r--r--vcl/unx/kde/salnativewidgets-kde.cxx7
36 files changed, 243 insertions, 199 deletions
diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx
index 0eb4c20ca250..8989bcc062bf 100644
--- a/i18npool/source/breakiterator/breakiteratorImpl.cxx
+++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx
@@ -267,7 +267,14 @@ static sal_Int32 SAL_CALL iterateCodePoints(const OUString& Text, sal_Int32 &nSt
nStartPos = nStartPos + inc < 0 ? -1 : Text.getLength();
} else {
ch = Text.iterateCodePoints(&nStartPos, inc);
- if (inc > 0) ch = Text.iterateCodePoints(&nStartPos, 0);
+ // Fix for #i80436#.
+ // erAck: 2009-06-30T21:52+0200 This logic looks somewhat
+ // suspicious as if it cures a symptom.. anyway, had to add
+ // nStartPos < Text.getLength() to silence the (correct) assertion
+ // in rtl_uString_iterateCodePoints() if Text was one character
+ // (codepoint) only, made up of a surrogate pair.
+ if (inc > 0 && nStartPos < Text.getLength())
+ ch = Text.iterateCodePoints(&nStartPos, 0);
}
return nStartPos;
}
diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx
index e69094064754..9ae58087a335 100644
--- a/rsc/source/parser/rscicpx.cxx
+++ b/rsc/source/parser/rscicpx.cxx
@@ -1449,6 +1449,9 @@ RscTop * RscTypCont::InitClassNumericFormatter( RscTop * pSuper )
nId = aNmTb.Put( "Value", VARNAME );
pClassNumeric->SetVariable( nId, &aIdLong, NULL,
0, NUMERICFORMATTER_VALUE );
+ nId = aNmTb.Put( "NoThousandSep", VARNAME );
+ pClassNumeric->SetVariable( nId, &aBool, NULL,
+ 0, NUMERICFORMATTER_NOTHOUSANDSEP );
return pClassNumeric;
}
@@ -1633,7 +1636,6 @@ RscTop * RscTypCont::InitClassNumericField( RscTop * pSuper )
nId = aNmTb.Put( "SpinSize", VARNAME );
pClassNumericField->SetVariable( nId, &aIdLong, NULL,
0, NUMERICFIELD_SPINSIZE );
-
return pClassNumericField;
}
diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx
index b3fba10cc911..717767d86e11 100644
--- a/sax/source/expatwrap/saxwriter.cxx
+++ b/sax/source/expatwrap/saxwriter.cxx
@@ -436,7 +436,7 @@ inline sal_Bool SaxWriterHelper::convertToXML( const sal_Unicode * pStr,
OSL_ENSURE( nSurrogate != 0, "lone 2nd Unicode surrogate" );
nSurrogate = ( nSurrogate << 10 ) | ( c & 0x03ff );
- if( nSurrogate > 0x00010000 && nSurrogate <= 0x001FFFFF )
+ if( nSurrogate >= 0x00010000 && nSurrogate <= 0x0010FFFF )
{
sal_Int8 aBytes[] = { sal_Int8(0xF0 | ((nSurrogate >> 18) & 0x0F)),
sal_Int8(0x80 | ((nSurrogate >> 12) & 0x3F)),
@@ -864,7 +864,7 @@ inline sal_Int32 calcXMLByteLength( const sal_Unicode *pStr, sal_Int32 nStrLen,
{
// 2. surrogate: write as UTF-8 (if range is OK
nSurrogate = ( nSurrogate << 10 ) | ( c & 0x03ff );
- if( nSurrogate > 0x00010000 && nSurrogate <= 0x001FFFFF )
+ if( nSurrogate >= 0x00010000 && nSurrogate <= 0x0010FFFF )
nOutputLength += 4;
nSurrogate = 0;
}
diff --git a/svtools/inc/dialogcontrolling.hxx b/svtools/inc/dialogcontrolling.hxx
index 9efb098ee013..edb425f78b00 100644
--- a/svtools/inc/dialogcontrolling.hxx
+++ b/svtools/inc/dialogcontrolling.hxx
@@ -52,7 +52,15 @@ namespace svt
class SVT_DLLPUBLIC SAL_NO_VTABLE IWindowOperator
{
public:
- virtual void operateOn( Window& _rOperateOn ) const = 0;
+ /** called when an event happened which should be reacted to
+
+ @param _rTrigger
+ the event which triggered the call. If the Id of the event is 0, then this is the initial
+ call which is made when ->_rOperateOn is added to the responsibility of the DialogController.
+ @param _rOperateOn
+ the window on which to operate
+ */
+ virtual void operateOn( const VclWindowEvent& _rTrigger, Window& _rOperateOn ) const = 0;
virtual ~IWindowOperator();
};
@@ -61,13 +69,13 @@ namespace svt
//=====================================================================
//= IWindowEventFilter
//=====================================================================
- /** an abstract interface for deciding whether a ->VclSimpleEvent
+ /** an abstract interface for deciding whether a ->VclWindowEvent
is worth paying attention to
*/
class SVT_DLLPUBLIC SAL_NO_VTABLE IWindowEventFilter
{
public:
- virtual bool payAttentionTo( const VclSimpleEvent& _rEvent ) const = 0;
+ virtual bool payAttentionTo( const VclWindowEvent& _rEvent ) const = 0;
virtual ~IWindowEventFilter();
};
@@ -96,7 +104,7 @@ namespace svt
::std::auto_ptr< DialogController_Data > m_pImpl;
public:
- DialogController( Window& _rInstigator, const PWindowEventFilter _pEventFilter, const PWindowOperator _pOperator );
+ DialogController( Window& _rInstigator, const PWindowEventFilter& _pEventFilter, const PWindowOperator& _pOperator );
virtual ~DialogController();
/** adds a window to the list of dependent windows
@@ -117,10 +125,10 @@ namespace svt
private:
void impl_Init();
- void impl_updateAll();
- void impl_update( Window& _rWindow );
+ void impl_updateAll( const VclWindowEvent& _rTriggerEvent );
+ void impl_update( const VclWindowEvent& _rTriggerEvent, Window& _rWindow );
- DECL_LINK( OnWindowEvent, const VclSimpleEvent* );
+ DECL_LINK( OnWindowEvent, const VclWindowEvent* );
private:
DialogController( const DialogController& ); // never implemented
@@ -184,10 +192,9 @@ namespace svt
/** adds a non-standard controller whose functionality is not covered by the other methods
@param _pController
- the controller to add to the manager. Must not be <NULL/>. The manager takes ownership
- of the controller.
+ the controller to add to the manager. Must not be <NULL/>.
*/
- void addController( DialogController* _pController );
+ void addController( const PDialogController& _pController );
private:
ControlDependencyManager( const ControlDependencyManager& ); // never implemented
@@ -224,7 +231,7 @@ namespace svt
{
}
- virtual void operateOn( Window& _rOperateOn ) const
+ virtual void operateOn( const VclWindowEvent& /*_rTrigger*/, Window& _rOperateOn ) const
{
_rOperateOn.Enable( m_rCheckable.IsChecked() );
}
@@ -248,12 +255,11 @@ namespace svt
{
}
- bool payAttentionTo( const VclSimpleEvent& _rEvent ) const
+ bool payAttentionTo( const VclWindowEvent& _rEvent ) const
{
- const VclWindowEvent& rWindowEvent = dynamic_cast< const VclWindowEvent& >( _rEvent );
- if ( ( rWindowEvent.GetWindow() == &m_rWindow )
- && ( ( rWindowEvent.GetId() == VCLEVENT_RADIOBUTTON_TOGGLE )
- || ( rWindowEvent.GetId() == VCLEVENT_CHECKBOX_TOGGLE )
+ if ( ( _rEvent.GetWindow() == &m_rWindow )
+ && ( ( _rEvent.GetId() == VCLEVENT_RADIOBUTTON_TOGGLE )
+ || ( _rEvent.GetId() == VCLEVENT_CHECKBOX_TOGGLE )
)
)
return true;
diff --git a/svtools/inc/svtools/embedhlp.hxx b/svtools/inc/svtools/embedhlp.hxx
index 08fe3c7d162a..f4cccd3115b8 100644
--- a/svtools/inc/svtools/embedhlp.hxx
+++ b/svtools/inc/svtools/embedhlp.hxx
@@ -131,6 +131,7 @@ namespace svt
BOOL is() const { return mxObj.is(); }
BOOL IsChart() 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/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx
index 767283a8e425..4ebed0d70f3f 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -538,7 +538,7 @@ void BrowseBox::SetColumnPos( USHORT nColumnId, USHORT nPos )
aScrollArea = Rectangle(Point(aNextRect.Left(),0),
Point(aToRect.Right(),aDataWinSize.Height()));
- pDataWin->Scroll( nScroll, 0, aScrollArea, SCROLL_FLAGS );
+ pDataWin->Scroll( nScroll, 0, aScrollArea );
aToRect.Top() = 0;
aToRect.Bottom() = aScrollArea.Bottom();
Invalidate( aToRect );
diff --git a/svtools/source/dialogs/wizdlg.cxx b/svtools/source/dialogs/wizdlg.cxx
index f0c69a24e4e4..aa0e62046ea6 100644
--- a/svtools/source/dialogs/wizdlg.cxx
+++ b/svtools/source/dialogs/wizdlg.cxx
@@ -303,8 +303,9 @@ void WizardDialog::ImplPosTabPage()
}
else if ( meViewAlign == WINDOWALIGN_LEFT )
{
- nOffX += aViewSize.Width()+WIZARDDIALOG_VIEW_DLGOFFSET_X;
- aDlgSize.Width() -= aViewSize.Width()+WIZARDDIALOG_VIEW_DLGOFFSET_X;
+ long nViewOffset = mbEmptyViewMargin ? 0 : WIZARDDIALOG_VIEW_DLGOFFSET_X;
+ nOffX += aViewSize.Width() + nViewOffset;
+ aDlgSize.Width() -= nOffX;
}
else if ( meViewAlign == WINDOWALIGN_BOTTOM )
aDlgSize.Height() -= aViewSize.Height()+WIZARDDIALOG_VIEW_DLGOFFSET_Y;
diff --git a/svtools/source/misc/dialogcontrolling.cxx b/svtools/source/misc/dialogcontrolling.cxx
index 01f9d4ed0eef..d461e5898227 100644
--- a/svtools/source/misc/dialogcontrolling.cxx
+++ b/svtools/source/misc/dialogcontrolling.cxx
@@ -79,8 +79,8 @@ namespace svt
//= DialogController
//=====================================================================
//---------------------------------------------------------------------
- DialogController::DialogController( Window& _rInstigator, const PWindowEventFilter _pEventFilter,
- const PWindowOperator _pOperator )
+ DialogController::DialogController( Window& _rInstigator, const PWindowEventFilter& _pEventFilter,
+ const PWindowOperator& _pOperator )
:m_pImpl( new DialogController_Data( _rInstigator, _pEventFilter, _pOperator ) )
{
DBG_ASSERT( m_pImpl->pEventFilter.get() && m_pImpl->pOperator.get(),
@@ -108,31 +108,33 @@ namespace svt
void DialogController::addDependentWindow( Window& _rWindow )
{
m_pImpl->aConcernedWindows.push_back( &_rWindow );
- impl_update( _rWindow );
+
+ VclWindowEvent aEvent( &_rWindow, 0, NULL );
+ impl_update( aEvent, _rWindow );
}
//---------------------------------------------------------------------
- IMPL_LINK( DialogController, OnWindowEvent, const VclSimpleEvent*, _pEvent )
+ IMPL_LINK( DialogController, OnWindowEvent, const VclWindowEvent*, _pEvent )
{
if ( m_pImpl->pEventFilter->payAttentionTo( *_pEvent ) )
- impl_updateAll();
+ impl_updateAll( *_pEvent );
return 0L;
}
//---------------------------------------------------------------------
- void DialogController::impl_updateAll()
+ void DialogController::impl_updateAll( const VclWindowEvent& _rTriggerEvent )
{
for ( ::std::vector< Window* >::iterator loop = m_pImpl->aConcernedWindows.begin();
loop != m_pImpl->aConcernedWindows.end();
++loop
)
- impl_update( *(*loop) );
+ impl_update( _rTriggerEvent, *(*loop) );
}
//---------------------------------------------------------------------
- void DialogController::impl_update( Window& _rWindow )
+ void DialogController::impl_update( const VclWindowEvent& _rTriggerEvent, Window& _rWindow )
{
- m_pImpl->pOperator->operateOn( _rWindow );
+ m_pImpl->pOperator->operateOn( _rTriggerEvent, _rWindow );
}
//=====================================================================
@@ -177,6 +179,13 @@ namespace svt
}
//---------------------------------------------------------------------
+ void ControlDependencyManager::addController( const PDialogController& _pController )
+ {
+ OSL_ENSURE( _pController.get() != NULL, "ControlDependencyManager::addController: invalid controller, this will crash, sooner or later!" );
+ m_pImpl->aControllers.push_back( _pController );
+ }
+
+ //---------------------------------------------------------------------
void ControlDependencyManager::enableOnRadioCheck( RadioButton& _rRadio, Window& _rDependentWindow )
{
PDialogController pController( new RadioDependentEnabler( _rRadio ) );
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index 8eaf915f3b0c..6bd1126f8082 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -54,6 +54,7 @@
#include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
#include <com/sun/star/util/XModifiable.hpp>
#include <com/sun/star/datatransfer/XTransferable.hpp>
+#include <com/sun/star/chart2/XDefaultSizeTransmitter.hpp>
#include <cppuhelper/implbase4.hxx>
#include "vcl/svapp.hxx"
#include <rtl/logfile.hxx>
@@ -249,6 +250,7 @@ struct EmbeddedObjectRef_Impl
sal_Int64 nViewAspect;
BOOL bIsLocked;
sal_Bool bNeedUpdate;
+ awt::Size aDefaultSizeForChart_In_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 member
};
void EmbeddedObjectRef::Construct_Impl()
@@ -260,6 +262,7 @@ void EmbeddedObjectRef::Construct_Impl()
mpImp->nViewAspect = embed::Aspects::MSOLE_CONTENT;
mpImp->bIsLocked = FALSE;
mpImp->bNeedUpdate = sal_False;
+ mpImp->aDefaultSizeForChart_In_100TH_MM = awt::Size(8000,7000);
}
EmbeddedObjectRef::EmbeddedObjectRef()
@@ -286,6 +289,7 @@ EmbeddedObjectRef::EmbeddedObjectRef( const EmbeddedObjectRef& rObj )
mpImp->aPersistName = rObj.mpImp->aPersistName;
mpImp->aMediaType = rObj.mpImp->aMediaType;
mpImp->bNeedUpdate = rObj.mpImp->bNeedUpdate;
+ mpImp->aDefaultSizeForChart_In_100TH_MM = rObj.mpImp->aDefaultSizeForChart_In_100TH_MM;
if ( rObj.mpImp->pGraphic && !rObj.mpImp->bNeedUpdate )
mpImp->pGraphic = new Graphic( *rObj.mpImp->pGraphic );
@@ -334,6 +338,14 @@ void EmbeddedObjectRef::Assign( const NS_UNO::Reference < NS_EMBED::XEmbeddedObj
mpImp->nViewAspect = nAspect;
mxObj = xObj;
mpImp->xListener = EmbedEventListener_Impl::Create( this );
+
+ //#i103460#
+ {
+ ::com::sun::star::uno::Reference < ::com::sun::star::chart2::XDefaultSizeTransmitter > xSizeTransmitter( xObj, uno::UNO_QUERY );
+ DBG_ASSERT( xSizeTransmitter.is(), "Object does not support XDefaultSizeTransmitter -> will cause #i103460#!" );
+ if( xSizeTransmitter.is() )
+ xSizeTransmitter->setDefaultSize( mpImp->aDefaultSizeForChart_In_100TH_MM );
+ }
}
void EmbeddedObjectRef::Clear()
@@ -902,4 +914,18 @@ BOOL EmbeddedObjectRef::IsChart() const
return sal_False;
}
+void EmbeddedObjectRef::SetDefaultSizeForChart( const Size& rSizeIn_100TH_MM )
+{
+ //#i103460# charts do not necessaryly have an own size within ODF files,
+ //for this case they need to use the size settings from the surrounding frame,
+ //which is made available with this method
+
+ mpImp->aDefaultSizeForChart_In_100TH_MM = awt::Size( rSizeIn_100TH_MM.getWidth(), rSizeIn_100TH_MM.getHeight() );
+
+ ::com::sun::star::uno::Reference < ::com::sun::star::chart2::XDefaultSizeTransmitter > xSizeTransmitter( mxObj, uno::UNO_QUERY );
+ DBG_ASSERT( xSizeTransmitter.is(), "Object does not support XDefaultSizeTransmitter -> will cause #i103460#!" );
+ if( xSizeTransmitter.is() )
+ xSizeTransmitter->setDefaultSize( mpImp->aDefaultSizeForChart_In_100TH_MM );
+}
+
}
diff --git a/toolkit/inc/toolkit/helper/vclunohelper.hxx b/toolkit/inc/toolkit/helper/vclunohelper.hxx
index 1c5d89a3cc64..e29b7237abb8 100644
--- a/toolkit/inc/toolkit/helper/vclunohelper.hxx
+++ b/toolkit/inc/toolkit/helper/vclunohelper.hxx
@@ -36,6 +36,7 @@
#include <com/sun/star/uno/Sequence.h>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/awt/MouseEvent.hpp>
namespace com { namespace sun { namespace star { namespace uno {
@@ -59,6 +60,7 @@ namespace com { namespace sun { namespace star { namespace awt {
struct SimpleFontMetric;
struct FontDescriptor;
struct Rectangle;
+ struct KeyEvent;
}}}}
@@ -71,6 +73,8 @@ namespace com { namespace sun { namespace star { namespace awt {
class Window;
class OutputDevice;
+class MouseEvent;
+class KeyEvent;
// ----------------------------------------------------
// class VclUnoHelper
@@ -144,6 +148,18 @@ public:
static ::Rectangle ConvertToVCLRect( ::com::sun::star::awt::Rectangle const & _rRect );
static ::com::sun::star::awt::Rectangle ConvertToAWTRect( ::Rectangle const & _rRect );
+
+ static ::com::sun::star::awt::MouseEvent
+ createMouseEvent(
+ const ::MouseEvent& _rVclEvent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext
+ );
+
+ static ::com::sun::star::awt::KeyEvent
+ createKeyEvent(
+ const ::KeyEvent& _rVclEvent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext
+ );
};
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index 337400c08713..a8c0912a583e 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -554,48 +554,6 @@ void ImplInitWindowEvent( ::com::sun::star::awt::WindowEvent& rEvent, Window* pW
pWindow->GetBorder( rEvent.LeftInset, rEvent.TopInset, rEvent.RightInset, rEvent.BottomInset );
}
-void ImplInitKeyEvent( ::com::sun::star::awt::KeyEvent& rEvent, const KeyEvent& rEvt )
-{
- rEvent.Modifiers = 0;
- if ( rEvt.GetKeyCode().IsShift() )
- rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::SHIFT;
- if ( rEvt.GetKeyCode().IsMod1() )
- rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD1;
- if ( rEvt.GetKeyCode().IsMod2() )
- rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD2;
- if ( rEvt.GetKeyCode().IsMod3() )
- rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD3;
-
- rEvent.KeyCode = rEvt.GetKeyCode().GetCode();
- rEvent.KeyChar = rEvt.GetCharCode();
- rEvent.KeyFunc = sal::static_int_cast< sal_Int16 >(
- rEvt.GetKeyCode().GetFunction());
-}
-
-void ImplInitMouseEvent( awt::MouseEvent& rEvent, const MouseEvent& rEvt )
-{
- rEvent.Modifiers = 0;
- if ( rEvt.IsShift() )
- rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::SHIFT;
- if ( rEvt.IsMod1() )
- rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD1;
- if ( rEvt.IsMod2() )
- rEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD2;
-
- rEvent.Buttons = 0;
- if ( rEvt.IsLeft() )
- rEvent.Buttons |= ::com::sun::star::awt::MouseButton::LEFT;
- if ( rEvt.IsRight() )
- rEvent.Buttons |= ::com::sun::star::awt::MouseButton::RIGHT;
- if ( rEvt.IsMiddle() )
- rEvent.Buttons |= ::com::sun::star::awt::MouseButton::MIDDLE;
-
- rEvent.X = rEvt.GetPosPixel().X();
- rEvent.Y = rEvt.GetPosPixel().Y();
- rEvent.ClickCount = rEvt.GetClicks();
- rEvent.PopupTrigger = sal_False;
-}
-
// ----------------------------------------------------
// class VCLXWindow
// ----------------------------------------------------
@@ -890,9 +848,9 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
{
if ( mpImpl->getKeyListeners().getLength() )
{
- ::com::sun::star::awt::KeyEvent aEvent;
- aEvent.Source = (::cppu::OWeakObject*)this;
- ImplInitKeyEvent( aEvent, *(KeyEvent*)rVclWindowEvent.GetData() );
+ ::com::sun::star::awt::KeyEvent aEvent( VCLUnoHelper::createKeyEvent(
+ *(KeyEvent*)rVclWindowEvent.GetData(), *this
+ ) );
mpImpl->getKeyListeners().keyPressed( aEvent );
}
}
@@ -901,9 +859,9 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
{
if ( mpImpl->getKeyListeners().getLength() )
{
- ::com::sun::star::awt::KeyEvent aEvent;
- aEvent.Source = (::cppu::OWeakObject*)this;
- ImplInitKeyEvent( aEvent, *(KeyEvent*)rVclWindowEvent.GetData() );
+ ::com::sun::star::awt::KeyEvent aEvent( VCLUnoHelper::createKeyEvent(
+ *(KeyEvent*)rVclWindowEvent.GetData(), *this
+ ) );
mpImpl->getKeyListeners().keyReleased( aEvent );
}
}
@@ -925,9 +883,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
}
MouseEvent aMEvt( aWhere, 1, MOUSE_SIMPLECLICK, MOUSE_LEFT, 0 );
- awt::MouseEvent aEvent;
- aEvent.Source = (::cppu::OWeakObject*)this;
- ImplInitMouseEvent( aEvent, aMEvt );
+ awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( aMEvt, *this ) );
aEvent.PopupTrigger = sal_True;
mpImpl->notifyMouseEvent( aEvent, EVENT_MOUSE_PRESSED );
}
@@ -938,10 +894,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
MouseEvent* pMouseEvt = (MouseEvent*)rVclWindowEvent.GetData();
if ( mpImpl->getMouseListeners().getLength() && ( pMouseEvt->IsEnterWindow() || pMouseEvt->IsLeaveWindow() ) )
{
- awt::MouseEvent aEvent;
- aEvent.Source = (::cppu::OWeakObject*)this;
- ImplInitMouseEvent( aEvent, *pMouseEvt );
-
+ awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( *pMouseEvt, *this ) );
mpImpl->notifyMouseEvent(
aEvent,
pMouseEvt->IsEnterWindow() ? EVENT_MOUSE_ENTERED : EVENT_MOUSE_EXITED
@@ -950,11 +903,8 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
if ( mpImpl->getMouseMotionListeners().getLength() && !pMouseEvt->IsEnterWindow() && !pMouseEvt->IsLeaveWindow() )
{
- awt::MouseEvent aEvent;
- aEvent.Source = (::cppu::OWeakObject*)this;
- ImplInitMouseEvent( aEvent, *pMouseEvt );
+ awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( *pMouseEvt, *this ) );
aEvent.ClickCount = 0; // #92138#
-
if ( pMouseEvt->GetMode() & MOUSE_SIMPLEMOVE )
mpImpl->getMouseMotionListeners().mouseMoved( aEvent );
else
@@ -966,9 +916,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
{
if ( mpImpl->getMouseListeners().getLength() )
{
- awt::MouseEvent aEvent;
- aEvent.Source = (::cppu::OWeakObject*)this;
- ImplInitMouseEvent( aEvent, *(MouseEvent*)rVclWindowEvent.GetData() );
+ awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( *(MouseEvent*)rVclWindowEvent.GetData(), *this ) );
mpImpl->notifyMouseEvent( aEvent, EVENT_MOUSE_PRESSED );
}
}
@@ -977,9 +925,7 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
{
if ( mpImpl->getMouseListeners().getLength() )
{
- awt::MouseEvent aEvent;
- aEvent.Source = (::cppu::OWeakObject*)this;
- ImplInitMouseEvent( aEvent, *(MouseEvent*)rVclWindowEvent.GetData() );
+ awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( *(MouseEvent*)rVclWindowEvent.GetData(), *this ) );
mpImpl->notifyMouseEvent( aEvent, EVENT_MOUSE_RELEASED );
}
}
diff --git a/toolkit/source/helper/vclunohelper.cxx b/toolkit/source/helper/vclunohelper.cxx
index 029e520baca6..89bde88d018e 100644
--- a/toolkit/source/helper/vclunohelper.cxx
+++ b/toolkit/source/helper/vclunohelper.cxx
@@ -45,6 +45,8 @@
#include <com/sun/star/awt/XControlContainer.hpp>
#include <com/sun/star/awt/FontWeight.hpp>
#include <com/sun/star/awt/FontWidth.hpp>
+#include <com/sun/star/awt/KeyModifier.hpp>
+#include <com/sun/star/awt/MouseButton.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/embed/EmbedMapUnits.hpp>
@@ -67,6 +69,8 @@
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/awt/Point.hpp>
+using namespace ::com::sun::star;
+
// ----------------------------------------------------
// class VCLUnoHelper
// ----------------------------------------------------
@@ -745,3 +749,54 @@ com::sun::star::awt::Point VCLUnoHelper::ConvertToAWTPoint(::Point /* VCLPoint *
{
return ::com::sun::star::awt::Rectangle( _rRect.Left(), _rRect.Top(), _rRect.GetWidth(), _rRect.GetHeight() );
}
+
+awt::MouseEvent VCLUnoHelper::createMouseEvent( const ::MouseEvent& _rVclEvent, const uno::Reference< uno::XInterface >& _rxContext )
+{
+ awt::MouseEvent aMouseEvent;
+ aMouseEvent.Source = _rxContext;
+
+ aMouseEvent.Modifiers = 0;
+ if ( _rVclEvent.IsShift() )
+ aMouseEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::SHIFT;
+ if ( _rVclEvent.IsMod1() )
+ aMouseEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD1;
+ if ( _rVclEvent.IsMod2() )
+ aMouseEvent.Modifiers |= ::com::sun::star::awt::KeyModifier::MOD2;
+
+ aMouseEvent.Buttons = 0;
+ if ( _rVclEvent.IsLeft() )
+ aMouseEvent.Buttons |= ::com::sun::star::awt::MouseButton::LEFT;
+ if ( _rVclEvent.IsRight() )
+ aMouseEvent.Buttons |= ::com::sun::star::awt::MouseButton::RIGHT;
+ if ( _rVclEvent.IsMiddle() )
+ aMouseEvent.Buttons |= ::com::sun::star::awt::MouseButton::MIDDLE;
+
+ aMouseEvent.X = _rVclEvent.GetPosPixel().X();
+ aMouseEvent.Y = _rVclEvent.GetPosPixel().Y();
+ aMouseEvent.ClickCount = _rVclEvent.GetClicks();
+ aMouseEvent.PopupTrigger = sal_False;
+
+ return aMouseEvent;
+}
+
+awt::KeyEvent VCLUnoHelper::createKeyEvent( const ::KeyEvent& _rVclEvent, const uno::Reference< uno::XInterface >& _rxContext )
+{
+ awt::KeyEvent aKeyEvent;
+ aKeyEvent.Source = _rxContext;
+
+ aKeyEvent.Modifiers = 0;
+ if ( _rVclEvent.GetKeyCode().IsShift() )
+ aKeyEvent.Modifiers |= awt::KeyModifier::SHIFT;
+ if ( _rVclEvent.GetKeyCode().IsMod1() )
+ aKeyEvent.Modifiers |= awt::KeyModifier::MOD1;
+ if ( _rVclEvent.GetKeyCode().IsMod2() )
+ aKeyEvent.Modifiers |= awt::KeyModifier::MOD2;
+ if ( _rVclEvent.GetKeyCode().IsMod3() )
+ aKeyEvent.Modifiers |= awt::KeyModifier::MOD3;
+
+ aKeyEvent.KeyCode = _rVclEvent.GetKeyCode().GetCode();
+ aKeyEvent.KeyChar = _rVclEvent.GetCharCode();
+ aKeyEvent.KeyFunc = ::sal::static_int_cast< sal_Int16 >( _rVclEvent.GetKeyCode().GetFunction());
+
+ return aKeyEvent;
+}
diff --git a/tools/inc/tools/rc.h b/tools/inc/tools/rc.h
index 11d6e2030162..8bad7dbf3f8a 100644
--- a/tools/inc/tools/rc.h
+++ b/tools/inc/tools/rc.h
@@ -102,6 +102,7 @@ typedef short RSWND_STYLE;
//#define NUMERICFORMATTER_I12 0x08 // erAck: got rid of class International (2005-06-17)
#define NUMERICFORMATTER_DECIMALDIGITS 0x10
#define NUMERICFORMATTER_VALUE 0x20
+#define NUMERICFORMATTER_NOTHOUSANDSEP 0x40
#define METRICFORMATTER_UNIT 0x01
#define METRICFORMATTER_CUSTOMUNITTEXT 0x02
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index 2aff0d734bf6..9b00480a1687 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -407,7 +407,7 @@ static INetURLObject::SchemeInfo const aSchemeInfoMap[INET_PROT_END]
{ "out", "out://", 0, true, false, false, false, false, false,
false, false },
{ "vnd.sun.star.wfs", "vnd.sun.star.wfs://", 0, true, false, false,
- false, true, false, true, false },
+ false, true, true, true, false },
{ "vnd.sun.star.hier", "vnd.sun.star.hier:", 0, true, false, false,
false, false, false, true, false },
{ "vim", "vim://", 0, true, true, false, true, false, false, true,
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 262910d18c82..b53ceceeb757 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -674,11 +674,11 @@ void Application::MergeSystemSettings( AllSettings& rSettings )
ImplSVData* pSVData = ImplGetSVData();
if ( !pSVData->maAppData.mbSettingsInit )
{
- pWindow->ImplGetFrame()->UpdateSettings( *pSVData->maAppData.mpSettings );
+ // side effect: ImplUpdateGlobalSettings does an ImplGetFrame()->UpdateSettings
pWindow->ImplUpdateGlobalSettings( *pSVData->maAppData.mpSettings );
pSVData->maAppData.mbSettingsInit = TRUE;
}
- pWindow->ImplGetFrame()->UpdateSettings( rSettings );
+ // side effect: ImplUpdateGlobalSettings does an ImplGetFrame()->UpdateSettings
pWindow->ImplUpdateGlobalSettings( rSettings, FALSE );
}
}
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 2e2342fc6fc8..e7a4aadb8694 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -420,10 +420,9 @@ void Button::ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos,
Image *pImage = &(mpButtonData->maImage);
BitmapEx *pBitmapEx = mpButtonData->mpBitmapEx;
- Color aBackCol;
- if( !!(mpButtonData->maImageHC) && ImplGetCurrentBackgroundColor( aBackCol ) )
+ if( !!(mpButtonData->maImageHC) )
{
- if( aBackCol.IsDark() )
+ if( GetSettings().GetStyleSettings().GetHighContrastMode() )
{
pImage = &(mpButtonData->maImageHC);
pBitmapEx = mpButtonData->mpBitmapExHC;
@@ -2375,14 +2374,10 @@ if ( bNativeOK == FALSE )
// check for HC mode
Image *pImage = &maImage;
- Color aBackCol;
- if( !!maImageHC && ImplGetCurrentBackgroundColor( aBackCol ) )
+ if( !!maImageHC )
{
- if( aBackCol.IsDark() )
+ if( rStyleSettings.GetHighContrastMode() )
pImage = &maImageHC;
- // #99902 no col transform required
- //if( aBackCol.IsBright() )
- // nStyle |= IMAGE_DRAW_COLORTRANSFORM;
}
Point aImagePos( aImageRect.TopLeft() );
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index 1bc6af51f369..3cb6e45f0400 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -503,6 +503,9 @@ void NumericFormatter::ImplLoadRes( const ResId& rResId )
mnFieldValue = mnMin;
mnLastValue = mnFieldValue;
}
+
+ if ( NUMERICFORMATTER_NOTHOUSANDSEP & nMask )
+ SetUseThousandSep( !(BOOL)pMgr->ReadShort() );
}
}
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index 530e928532e1..ecb066d107ce 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -804,13 +804,10 @@ void FixedBitmap::ImplDraw( OutputDevice* pDev, ULONG /* nDrawFlags */,
USHORT nStyle = 0;
Bitmap* pBitmap = &maBitmap;
Color aCol;
- if( !!maBitmapHC && ImplGetCurrentBackgroundColor( aCol ) )
+ if( !!maBitmapHC )
{
- if( aCol.IsDark() )
+ if( GetSettings().GetStyleSettings().GetHighContrastMode() )
pBitmap = &maBitmapHC;
- // #99902 no col transform required
- //if( aCol.IsBright() )
- // nStyle |= IMAGE_DRAW_COLORTRANSFORM;
}
if( nStyle & IMAGE_DRAW_COLORTRANSFORM )
@@ -1058,13 +1055,10 @@ void FixedImage::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
Image *pImage = &maImage;
Color aCol;
- if( !!maImageHC && ImplGetCurrentBackgroundColor( aCol ) )
+ if( !!maImageHC )
{
- if( aCol.IsDark() )
+ if( GetSettings().GetStyleSettings().GetHighContrastMode() )
pImage = &maImageHC;
- // #99902 no col transform required
- //if( aCol.IsBright() )
- // nStyle |= IMAGE_DRAW_COLORTRANSFORM;
}
// Haben wir ueberhaupt ein Image
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index a25ddbb68e8b..c0a28c8b03fd 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -2899,23 +2899,8 @@ void ImplWin::DrawEntry( BOOL bDrawImage, BOOL bDrawText, BOOL bDrawTextAtImageP
if( !!maImageHC )
{
- // determine backgroundcolor as done in Paint()
- Color aBackCol;
- if( IsEnabled() )
- {
- if( HasFocus() )
- aBackCol = GetSettings().GetStyleSettings().GetHighlightColor();
- else
- aBackCol = GetBackground().GetColor();
- }
- else // Disabled
- aBackCol = GetBackground().GetColor();
-
- if( aBackCol.IsDark() )
+ if( GetSettings().GetStyleSettings().GetHighContrastMode() )
pImage = &maImageHC;
- // #99902 no col transform required
- //if( aBackCol.IsBright() )
- // nStyle |= IMAGE_DRAW_COLORTRANSFORM;
}
if ( !IsZoom() )
diff --git a/vcl/source/control/imgctrl.cxx b/vcl/source/control/imgctrl.cxx
index 6d4777013a73..73b5154d32ac 100644
--- a/vcl/source/control/imgctrl.cxx
+++ b/vcl/source/control/imgctrl.cxx
@@ -93,14 +93,10 @@ void ImageControl::UserDraw( const UserDrawEvent& rUDEvt )
{
USHORT nStyle = 0;
BitmapEx* pBitmap = &maBmp;
- Color aCol;
- if( !!maBmpHC && ImplGetCurrentBackgroundColor( aCol ) )
+ if( !!maBmpHC )
{
- if( aCol.IsDark() )
+ if( GetSettings().GetStyleSettings().GetHighContrastMode() )
pBitmap = &maBmpHC;
- // #99902 no col transform required
- //if( aCol.IsBright() )
- // nStyle |= IMAGE_DRAW_COLORTRANSFORM;
}
if ( !*pBitmap )
diff --git a/vcl/source/fontsubset/fontsubset.cxx b/vcl/source/fontsubset/fontsubset.cxx
index e203feed1645..84f548d0a32f 100644
--- a/vcl/source/fontsubset/fontsubset.cxx
+++ b/vcl/source/fontsubset/fontsubset.cxx
@@ -40,7 +40,7 @@ FontSubsetInfo::FontSubsetInfo()
, m_nCapHeight( 0)
, m_nFontType( FontSubsetInfo::NO_FONT)
, mpInFontBytes( NULL)
-, mnInByteLength( NULL)
+, mnInByteLength( 0)
, meInFontType( FontSubsetInfo::NO_FONT)
, mpSftTTFont( NULL)
{}
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 0a6b778681e1..0a7a8b765b6b 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -6782,17 +6782,21 @@ void OutputDevice::ImplDrawText( const Rectangle& rRect,
{
BOOL bHighContrastBlack = FALSE;
BOOL bHighContrastWhite = FALSE;
- Color aCol;
- if( IsBackground() )
- aCol = GetBackground().GetColor();
- else
- // best guess is the face color here
- // but it may be totally wrong. the background color
- // was typically already reset
- aCol = GetSettings().GetStyleSettings().GetFaceColor();
+ const StyleSettings& rStyleSettings( GetSettings().GetStyleSettings() );
+ if( rStyleSettings.GetHighContrastMode() )
+ {
+ Color aCol;
+ if( IsBackground() )
+ aCol = GetBackground().GetColor();
+ else
+ // best guess is the face color here
+ // but it may be totally wrong. the background color
+ // was typically already reset
+ aCol = rStyleSettings.GetFaceColor();
- bHighContrastBlack = aCol.IsDark();
- bHighContrastWhite = aCol.IsBright() && GetSettings().GetStyleSettings().GetHighContrastMode();
+ bHighContrastBlack = aCol.IsDark();
+ bHighContrastWhite = aCol.IsBright();
+ }
aOldTextColor = GetTextColor();
if ( IsTextFillColor() )
@@ -6800,8 +6804,6 @@ void OutputDevice::ImplDrawText( const Rectangle& rRect,
bRestoreFillColor = TRUE;
aOldTextFillColor = GetTextFillColor();
}
- else
- bRestoreFillColor = FALSE;
if( bHighContrastBlack )
SetTextColor( COL_GREEN );
else if( bHighContrastWhite )
@@ -6816,7 +6818,7 @@ void OutputDevice::ImplDrawText( const Rectangle& rRect,
aRect.Move( 1, 1 );
DrawText( aRect, rOrigStr, nStyle & ~TEXT_DRAW_DISABLE );
*/
- SetTextColor( GetSettings().GetStyleSettings().GetShadowColor() );
+ SetTextColor( GetSettings().GetStyleSettings().GetDisableColor() );
}
}
@@ -7450,13 +7452,18 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
BOOL bRestoreFillColor;
BOOL bHighContrastBlack = FALSE;
BOOL bHighContrastWhite = FALSE;
- if( IsBackground() )
+ const StyleSettings& rStyleSettings( GetSettings().GetStyleSettings() );
+ if( rStyleSettings.GetHighContrastMode() )
{
- Wallpaper aWall = GetBackground();
- Color aCol = aWall.GetColor();
- bHighContrastBlack = aCol.IsDark();
- bHighContrastWhite = aCol.IsBright() && GetSettings().GetStyleSettings().GetHighContrastMode();
+ if( IsBackground() )
+ {
+ Wallpaper aWall = GetBackground();
+ Color aCol = aWall.GetColor();
+ bHighContrastBlack = aCol.IsDark();
+ bHighContrastWhite = aCol.IsBright();
+ }
}
+
aOldTextColor = GetTextColor();
if ( IsTextFillColor() )
{
@@ -7471,7 +7478,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
else if( bHighContrastWhite )
SetTextColor( COL_LIGHTGREEN );
else
- SetTextColor( GetSettings().GetStyleSettings().GetShadowColor() );
+ SetTextColor( GetSettings().GetStyleSettings().GetDisableColor() );
DrawText( rPos, aStr, nIndex, nLen, pVector, pDisplayText );
if ( !(GetSettings().GetStyleSettings().GetOptions() & STYLE_OPTION_NOMNEMONICS) && !pVector )
diff --git a/vcl/source/gdi/wall.cxx b/vcl/source/gdi/wall.cxx
index e0c69ce582f4..587395fa783f 100644
--- a/vcl/source/gdi/wall.cxx
+++ b/vcl/source/gdi/wall.cxx
@@ -469,7 +469,7 @@ Gradient Wallpaper::ImplGetApplicationGradient() const
g.SetStyle( GRADIENT_LINEAR );
g.SetStartColor( Application::GetSettings().GetStyleSettings().GetFaceColor() );
// no 'extreme' gradient when high contrast
- if( Application::GetSettings().GetStyleSettings().GetFaceColor().IsDark() )
+ if( Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
g.SetEndColor( Application::GetSettings().GetStyleSettings().GetFaceColor() );
else
g.SetEndColor( Application::GetSettings().GetStyleSettings().GetFaceGradientColor() );
diff --git a/vcl/source/glyphs/graphite_adaptors.cxx b/vcl/source/glyphs/graphite_adaptors.cxx
index 67330698ffdf..9b16318fdc40 100644
--- a/vcl/source/glyphs/graphite_adaptors.cxx
+++ b/vcl/source/glyphs/graphite_adaptors.cxx
@@ -47,7 +47,7 @@
#include <rtl/ustring.hxx>
#include <i18npool/mslangid.hxx>
// Platform
-#ifndef MSC
+#ifndef WNT
#include <saldisp.hxx>
#include <vcl/salgdi.hxx>
diff --git a/vcl/source/glyphs/graphite_cache.cxx b/vcl/source/glyphs/graphite_cache.cxx
index c1bca0f87cb8..8c514c611d2c 100644
--- a/vcl/source/glyphs/graphite_cache.cxx
+++ b/vcl/source/glyphs/graphite_cache.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifdef MSC
+#ifdef WNT
#include <tools/svwin.h>
#include <svsys.h>
#endif
diff --git a/vcl/source/glyphs/graphite_features.cxx b/vcl/source/glyphs/graphite_features.cxx
index 3c5214d3c420..dae1bfc2866e 100644
--- a/vcl/source/glyphs/graphite_features.cxx
+++ b/vcl/source/glyphs/graphite_features.cxx
@@ -38,7 +38,7 @@
#include <sal/types.h>
-#ifdef MSC
+#ifdef WNT
#include <tools/svwin.h>
#include <svsys.h>
#endif
diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx
index 751c3694d033..86dee2749efa 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -54,7 +54,7 @@
#include <deque>
// Platform
-#ifdef MSC
+#ifdef WNT
#include <tools/svwin.h>
#include <svsys.h>
#endif
@@ -86,7 +86,7 @@
FILE * grLogFile = NULL;
FILE * grLog()
{
-#ifdef MSC
+#ifdef WNT
std::string logFileName(getenv("TEMP"));
logFileName.append("\\graphitelayout.log");
if (grLogFile == NULL) grLogFile = fopen(logFileName.c_str(),"w");
@@ -135,7 +135,7 @@ namespace
UErrorCode status = U_ZERO_ERROR;
UBiDi *ubidi = ubidi_openSized(charCount, 0, &status);
int limit = 0;
- ubidi_setPara(ubidi, buffer, charCount,
+ ubidi_setPara(ubidi, reinterpret_cast<const UChar *>(buffer), charCount,
(rtl)?UBIDI_DEFAULT_RTL:UBIDI_DEFAULT_LTR, NULL, &status);
UBiDiLevel level = 0;
ubidi_getLogicalRun(ubidi, 0, &limit, &level);
diff --git a/vcl/source/glyphs/graphite_serverfont.cxx b/vcl/source/glyphs/graphite_serverfont.cxx
index e8cd152b43ac..be424c94b9d2 100644
--- a/vcl/source/glyphs/graphite_serverfont.cxx
+++ b/vcl/source/glyphs/graphite_serverfont.cxx
@@ -45,7 +45,7 @@
#include "graphite_textsrc.hxx"
#include <vcl/graphite_serverfont.hxx>
-#ifndef MSC
+#ifndef WNT
//
// An implementation of the GraphiteLayout interface to enable Graphite enabled fonts to be used.
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 9ce8030c4bb9..ebd4475a80fc 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -557,7 +557,7 @@ public:
void DataChanged( const DataChangedEvent& rDCEvt );
- void SetImages( long nMaxHeight = 0 );
+ void SetImages( long nMaxHeight = 0, bool bForce = false );
void calcMinSize();
Size getMinSize();
@@ -591,7 +591,7 @@ void DecoToolBox::DataChanged( const DataChangedEvent& rDCEvt )
{
calcMinSize();
SetBackground();
- SetImages();
+ SetImages( 0, true);
}
}
@@ -625,7 +625,7 @@ Size DecoToolBox::getMinSize()
return maMinSize;
}
-void DecoToolBox::SetImages( long nMaxHeight )
+void DecoToolBox::SetImages( long nMaxHeight, bool bForce )
{
long border = getMinSize().Height() - maImage.GetSizePixel().Height();
@@ -635,13 +635,13 @@ void DecoToolBox::SetImages( long nMaxHeight )
if( nMaxHeight < getMinSize().Height() )
nMaxHeight = getMinSize().Height();
- if( lastSize != nMaxHeight - border )
+ if( (lastSize != nMaxHeight - border) || bForce )
{
lastSize = nMaxHeight - border;
Color aEraseColor( 255, 255, 255, 255 );
BitmapEx aBmpExDst( maImage.GetBitmapEx() );
- BitmapEx aBmpExSrc( GetSettings().GetStyleSettings().GetMenuBarColor().IsDark() ?
+ BitmapEx aBmpExSrc( GetSettings().GetStyleSettings().GetHighContrastMode() ?
maImageHC.GetBitmapEx() : aBmpExDst );
aEraseColor.SetTransparency( 255 );
@@ -5066,7 +5066,7 @@ MenuBarWindow::MenuBarWindow( Window* pParent ) :
aCloser.SetParentClipMode( PARENTCLIPMODE_NOCLIP );
aCloser.InsertItem( IID_DOCUMENTCLOSE,
- GetSettings().GetStyleSettings().GetMenuBarColor().IsDark() ? aCloser.maImageHC : aCloser.maImage, 0 );
+ GetSettings().GetStyleSettings().GetHighContrastMode() ? aCloser.maImageHC : aCloser.maImage, 0 );
aCloser.SetSelectHdl( LINK( this, MenuBarWindow, CloserHdl ) );
aCloser.AddEventListener( LINK( this, MenuBarWindow, ToolboxEventHdl ) );
aCloser.SetQuickHelpText( IID_DOCUMENTCLOSE, XubString( ResId( SV_HELPTEXT_CLOSEDOCUMENT, *pResMgr ) ) );
@@ -5707,7 +5707,7 @@ void MenuBarWindow::Paint( const Rectangle& )
// in high contrast mode draw a separating line on the lower edge
if( ! IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL) &&
- GetSettings().GetStyleSettings().GetFaceColor().IsDark() )
+ GetSettings().GetStyleSettings().GetHighContrastMode() )
{
Push( PUSH_LINECOLOR | PUSH_MAPMODE );
SetLineColor( Color( COL_WHITE ) );
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
index bd727092a836..3d3245af831f 100644
--- a/vcl/source/window/msgbox.cxx
+++ b/vcl/source/window/msgbox.cxx
@@ -500,7 +500,7 @@ void InfoBox::ImplInitInfoBoxData()
if ( !GetText().Len() )
SetText( Application::GetDisplayName() );
- SetImage( GetSettings().GetStyleSettings().GetDialogColor().IsDark() ?
+ SetImage( GetSettings().GetStyleSettings().GetHighContrastMode() ?
InfoBox::GetStandardImageHC() : InfoBox::GetStandardImage() );
mnSoundType = ((USHORT)SOUND_INFO)+1;
}
@@ -591,7 +591,7 @@ void ErrorBox::ImplInitErrorBoxData()
if ( !GetText().Len() )
SetText( Application::GetDisplayName() );
- SetImage( GetSettings().GetStyleSettings().GetDialogColor().IsDark() ?
+ SetImage( GetSettings().GetStyleSettings().GetHighContrastMode() ?
ErrorBox::GetStandardImageHC() : ErrorBox::GetStandardImage() );
mnSoundType = ((USHORT)SOUND_ERROR)+1;
}
@@ -637,7 +637,7 @@ void QueryBox::ImplInitQueryBoxData()
if ( !GetText().Len() )
SetText( Application::GetDisplayName() );
- SetImage( GetSettings().GetStyleSettings().GetDialogColor().IsDark() ?
+ SetImage( GetSettings().GetStyleSettings().GetHighContrastMode() ?
QueryBox::GetStandardImageHC() : QueryBox::GetStandardImage() );
mnSoundType = ((USHORT)SOUND_QUERY)+1;
}
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 68fa3b74ccf1..8aa4926f5e1a 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -397,7 +397,7 @@ void ToolBox::ImplDrawGradientBackground( ToolBox* pThis, ImplDockingWindowWrapp
Color startCol, endCol;
startCol = pThis->GetSettings().GetStyleSettings().GetFaceGradientColor();
endCol = pThis->GetSettings().GetStyleSettings().GetFaceColor();
- if( endCol.IsDark() )
+ if( pThis->GetSettings().GetStyleSettings().GetHighContrastMode() )
// no 'extreme' gradient when high contrast
startCol = endCol;
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 7fa8f76e1586..9ec86fab20de 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -2413,10 +2413,10 @@ void ToolBox::ImplUpdateImageList()
{
if (mpData->mpImageListProvider != NULL)
{
- BOOL bIsDark = GetSettings().GetStyleSettings().GetFaceColor().IsDark();
+ BOOL bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
try
{
- ImageListType eType = bIsDark ? vcl::HIGHCONTRAST_YES : vcl::HIGHCONTRAST_NO;
+ ImageListType eType = bHC ? vcl::HIGHCONTRAST_YES : vcl::HIGHCONTRAST_NO;
if (eType != mpData->meImageListType)
{
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 5333d20d4306..aa06e0154f0b 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -292,6 +292,13 @@ 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 );
+ ImplGetFrame()->UpdateSettings( rSettings );
+
// Verify availability of the configured UI font, otherwise choose "Andale Sans UI"
String aUserInterfaceFont;
bool bUseSystemFont = rSettings.GetStyleSettings().GetUseSystemUIFonts();
@@ -472,7 +479,8 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl )
rSettings.SetStyleSettings( aStyleSettings );
- // #104427# auto detect HC mode ?
+ // auto detect HC mode; if the system already set it to "yes"
+ // (see above) then accept that
if( !rSettings.GetStyleSettings().GetHighContrastMode() )
{
sal_Bool bTmp = sal_False, bAutoHCMode = sal_True;
@@ -923,7 +931,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
! (nStyle & (WB_INTROWIN|WB_DEFAULTWIN))
)
{
- mpWindowImpl->mpFrame->UpdateSettings( *pSVData->maAppData.mpSettings );
+ // side effect: ImplUpdateGlobalSettings does an ImplGetFrame()->UpdateSettings
ImplUpdateGlobalSettings( *pSVData->maAppData.mpSettings );
OutputDevice::SetSettings( *pSVData->maAppData.mpSettings );
pSVData->maAppData.mbSettingsInit = TRUE;
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 6208d3b859c2..f922552ce923 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -3465,13 +3465,6 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
// FIXME: need some way of fetching toolbar icon size.
// aStyleSet.SetToolbarIconSize( STYLE_TOOLBAR_ICONSIZE_SMALL );
- /* #i35482# do not override HC mode per force
- // #i59364# high contrast mode
- bool bHC = ( aStyleSet.GetFaceColor().IsDark() ||
- aStyleSet.GetWindowColor().IsDark() );
- aStyleSet.SetHighContrastMode( bHC );
- */
-
// finally update the collected settings
rSettings.SetStyleSettings( aStyleSet );
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index b6770ca1a77e..aa7b4830420a 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -1123,7 +1123,7 @@ void GtkSalFrame::SetIcon( USHORT nIcon )
USHORT nIndex;
// Use high contrast icons where appropriate
- if( Application::GetSettings().GetStyleSettings().GetFaceColor().IsDark() )
+ if( Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
{
nOffsets[0] = SV_ICON_LARGE_HC_START;
nOffsets[1] = SV_ICON_SMALL_HC_START;
diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx
index f5a2b57eb6a2..8046d22d75d3 100644
--- a/vcl/unx/kde/salnativewidgets-kde.cxx
+++ b/vcl/unx/kde/salnativewidgets-kde.cxx
@@ -2036,13 +2036,6 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
// Scroll bar size
aStyleSettings.SetScrollBarSize( kapp->style().pixelMetric( QStyle::PM_ScrollBarExtent ) );
- /* #i35482# do not override HC mode
- // #i59364# high contrast mode
- bool bHC = ( aStyleSettings.GetFaceColor().IsDark() ||
- aStyleSettings.GetWindowColor().IsDark() );
- aStyleSettings.SetHighContrastMode( bHC );
- */
-
rSettings.SetStyleSettings( aStyleSettings );
}