summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorsb <sb@openoffice.org>2009-12-07 09:34:25 +0100
committersb <sb@openoffice.org>2009-12-07 09:34:25 +0100
commita751d389a4796459c0c5271682badd8330456514 (patch)
tree0e38517c270bde9e022d2ee033ba3752ac8cde97 /sc/source
parent003e500ae984553d7f47008ad15d0974aae9b8bf (diff)
parent6412003193f79e16f4aa33f206b736e3c9bf6bc3 (diff)
merged in DEV300_m66
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/cell.cxx6
-rw-r--r--sc/source/core/data/column.cxx4
-rw-r--r--sc/source/core/data/document.cxx6
-rw-r--r--sc/source/core/data/table1.cxx17
-rw-r--r--sc/source/core/data/table5.cxx6
-rw-r--r--sc/source/filter/excel/xename.cxx12
-rw-r--r--sc/source/ui/app/inputwin.cxx12
-rw-r--r--sc/source/ui/cctrl/tbinsert.cxx2
-rw-r--r--sc/source/ui/cctrl/tbzoomsliderctrl.cxx8
-rw-r--r--sc/source/ui/dbgui/tpsubt.cxx4
-rw-r--r--sc/source/ui/docshell/arealink.cxx4
-rw-r--r--sc/source/ui/docshell/docfunc.cxx6
-rw-r--r--sc/source/ui/docshell/docsh.cxx12
-rw-r--r--sc/source/ui/docshell/docsh5.cxx3
-rw-r--r--sc/source/ui/docshell/olinefun.cxx12
-rw-r--r--sc/source/ui/inc/privsplt.hxx1
-rw-r--r--sc/source/ui/navipi/navipi.cxx12
-rw-r--r--sc/source/ui/pagedlg/tptable.cxx4
-rw-r--r--sc/source/ui/unoobj/targuno.cxx2
-rw-r--r--sc/source/ui/view/olinewin.cxx2
20 files changed, 102 insertions, 33 deletions
diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index aea2bf4ff276..cfd7caafa3f3 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -1641,8 +1641,9 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
if ( eOld == svHybridCell ) // string result from SetFormulaResultString?
eOld = svString; // ScHybridCellToken has a valid GetString method
+ // #i106045# use approxEqual to compare with stored value
bContentChanged = (eOld != eNew ||
- (eNew == svDouble && aResult.GetDouble() != aNewResult.GetDouble()) ||
+ (eNew == svDouble && !rtl::math::approxEqual( aResult.GetDouble(), aNewResult.GetDouble() )) ||
(eNew == svString && aResult.GetString() != aNewResult.GetString()));
}
}
@@ -1662,7 +1663,8 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
if ( bChanged && !bContentChanged && pDocument->IsStreamValid(aPos.Tab()) )
{
if ( ( eOld == svUnknown && ( eNew == svError || ( eNew == svDouble && aNewResult.GetDouble() == 0.0 ) ) ) ||
- ( eOld == svHybridCell && eNew == svString && aResult.GetString() == aNewResult.GetString() ) )
+ ( eOld == svHybridCell && eNew == svString && aResult.GetString() == aNewResult.GetString() ) ||
+ ( eOld == svDouble && eNew == svDouble && rtl::math::approxEqual( aResult.GetDouble(), aNewResult.GetDouble() ) ) )
{
// no change, see above
}
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 0afc4fb1347c..afcd809eed1d 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1233,8 +1233,8 @@ void ScColumn::InsertRow( SCROW nStartRow, SCSIZE nSize )
}
}
- delete pDelRows;
- delete ppDelCells;
+ delete [] pDelRows;
+ delete [] ppDelCells;
}
pDocument->SetAutoCalc( bOldAutoCalc );
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 8b04d5a0500e..077983b4382b 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -476,6 +476,12 @@ BOOL ScDocument::RenameTab( SCTAB nTab, const String& rName, BOOL /* bUpdateRef
if ( pChartListenerCollection )
pChartListenerCollection->UpdateChartsContainingTab( nTab );
pTab[nTab]->SetName(rName);
+
+ // If formulas refer to the renamed sheet, the TokenArray remains valid,
+ // but the XML stream must be re-generated.
+ for (i=0; i<=MAXTAB; ++i)
+ if (pTab[i] && pTab[i]->IsStreamValid())
+ pTab[i]->SetStreamValid( FALSE );
}
}
return bValid;
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 10197e3a9ad5..403377342661 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -238,6 +238,8 @@ void ScTable::SetName( const String& rNewName )
bIsOlk = bOderSo = TRUE;
aName = rNewName;
aUpperName.Erase(); // invalidated if the name is changed
+
+ // SetStreamValid is handled in ScDocument::RenameTab
}
const String& ScTable::GetUpperName() const
@@ -291,6 +293,9 @@ void ScTable::SetLink( BYTE nMode,
aLinkOpt = rOpt; // Filter-Optionen
aLinkTab = rTab; // Tabellenname in Quelldatei
nLinkRefreshDelay = nRefreshDelay; // refresh delay in seconds, 0==off
+
+ if (IsStreamValid())
+ SetStreamValid(FALSE);
}
USHORT ScTable::GetOptimalColWidth( SCCOL nCol, OutputDevice* pDev,
@@ -1457,17 +1462,26 @@ void ScTable::DoColResize( SCCOL nCol1, SCCOL nCol2, SCSIZE nAdd )
void ScTable::SetRepeatColRange( const ScRange* pNew )
{
SET_PRINTRANGE( pRepeatColRange, pNew );
+
+ if (IsStreamValid())
+ SetStreamValid(FALSE);
}
void ScTable::SetRepeatRowRange( const ScRange* pNew )
{
SET_PRINTRANGE( pRepeatRowRange, pNew );
+
+ if (IsStreamValid())
+ SetStreamValid(FALSE);
}
void ScTable::ClearPrintRanges()
{
aPrintRanges.clear();
bPrintEntireSheet = FALSE;
+
+ if (IsStreamValid())
+ SetStreamValid(FALSE);
}
void ScTable::AddPrintRange( const ScRange& rNew )
@@ -1475,6 +1489,9 @@ void ScTable::AddPrintRange( const ScRange& rNew )
bPrintEntireSheet = FALSE;
if( aPrintRanges.size() < 0xFFFF )
aPrintRanges.push_back( rNew );
+
+ if (IsStreamValid())
+ SetStreamValid(FALSE);
}
//UNUSED2009-05 void ScTable::SetPrintRange( const ScRange& rNew )
diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx
index eb959dfb2ffa..4a0cd9e135d5 100644
--- a/sc/source/core/data/table5.cxx
+++ b/sc/source/core/data/table5.cxx
@@ -249,6 +249,9 @@ void ScTable::RemoveManualBreaks()
if (pRowFlags)
pRowFlags->AndValue( 0, MAXROW, sal::static_int_cast<BYTE>(~CR_MANUALBREAK) );
+
+ if (IsStreamValid())
+ SetStreamValid(FALSE);
}
BOOL ScTable::HasManualBreaks() const
@@ -287,6 +290,9 @@ void ScTable::SetProtection(const ScTableProtection* pProtect)
pTabProtection.reset(new ScTableProtection(*pProtect));
else
pTabProtection.reset(NULL);
+
+ if (IsStreamValid())
+ SetStreamValid(FALSE);
}
ScTableProtection* ScTable::GetProtection()
diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx
index ace7a66dc1f9..004fbfa2932c 100644
--- a/sc/source/filter/excel/xename.cxx
+++ b/sc/source/filter/excel/xename.cxx
@@ -636,10 +636,13 @@ void XclExpNameManagerImpl::CreateBuiltInNames()
// Calc document does not care about sheet index in print ranges
aRange.aStart.SetTab( nScTab );
aRange.aEnd.SetTab( nScTab );
+ aRange.Justify();
aRangeList.Append( aRange );
}
- GetAddressConverter().ValidateRangeList( aRangeList, true );
- GetNameManager().InsertBuiltInName( EXC_BUILTIN_PRINTAREA, aRangeList );
+ // create the NAME record (do not warn if ranges are shrunken)
+ GetAddressConverter().ValidateRangeList( aRangeList, false );
+ if( aRangeList.Count() > 0 )
+ GetNameManager().InsertBuiltInName( EXC_BUILTIN_PRINTAREA, aRangeList );
}
// *** 2) print titles *** ----------------------------------------
@@ -656,8 +659,9 @@ void XclExpNameManagerImpl::CreateBuiltInNames()
0, pRowRange->aStart.Row(), nScTab,
GetXclMaxPos().Col(), pRowRange->aEnd.Row(), nScTab ) );
// create the NAME record
- GetAddressConverter().ValidateRangeList( aTitleList, true );
- GetNameManager().InsertBuiltInName( EXC_BUILTIN_PRINTTITLES, aTitleList );
+ GetAddressConverter().ValidateRangeList( aTitleList, false );
+ if( aTitleList.Count() > 0 )
+ GetNameManager().InsertBuiltInName( EXC_BUILTIN_PRINTTITLES, aTitleList );
// *** 3) filter ranges *** ---------------------------------------
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 5a3fd605b08f..33f26947f49f 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -131,7 +131,7 @@ SfxChildWinInfo __EXPORT ScInputWindowWrapper::GetInfo() const
//==================================================================
-#define IMAGE(id) pImgMgr->SeekImage(id, bDark)
+#define IMAGE(id) pImgMgr->SeekImage(id, bHC)
//==================================================================
// class ScInputWindow
@@ -170,7 +170,7 @@ ScInputWindow::ScInputWindow( Window* pParent, SfxBindings* pBind ) :
}
DBG_ASSERT( pViewSh, "no view shell for input window" );
- BOOL bDark = GetSettings().GetStyleSettings().GetFaceColor().IsDark();
+ BOOL bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
// Positionsfenster, 3 Buttons, Eingabefenster
InsertWindow ( 1, &aWndPos, 0, 0 );
@@ -558,7 +558,7 @@ void ScInputWindow::SetOkCancelMode()
SfxImageManager* pImgMgr = SfxImageManager::GetImageManager( pScMod );
if (!bIsOkCancelMode)
{
- BOOL bDark = GetSettings().GetStyleSettings().GetFaceColor().IsDark();
+ BOOL bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
RemoveItem( 3 ); // SID_INPUT_SUM und SID_INPUT_EQUAL entfernen
RemoveItem( 3 );
@@ -582,7 +582,7 @@ void ScInputWindow::SetSumAssignMode()
SfxImageManager* pImgMgr = SfxImageManager::GetImageManager( pScMod );
if (bIsOkCancelMode)
{
- BOOL bDark = GetSettings().GetStyleSettings().GetFaceColor().IsDark();
+ BOOL bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
// SID_INPUT_CANCEL, und SID_INPUT_OK entfernen
RemoveItem( 3 );
@@ -710,8 +710,8 @@ void ScInputWindow::DataChanged( const DataChangedEvent& rDCEvt )
ScModule* pScMod = SC_MOD();
SfxImageManager* pImgMgr = SfxImageManager::GetImageManager( pScMod );
- BOOL bDark = GetSettings().GetStyleSettings().GetFaceColor().IsDark();
- // IMAGE macro uses pScMod, pImgMgr, bDark
+ BOOL bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
+ // IMAGE macro uses pScMod, pImgMgr, bHC
SetItemImage( SID_INPUT_FUNCTION, IMAGE( SID_INPUT_FUNCTION ) );
if ( bIsOkCancelMode )
diff --git a/sc/source/ui/cctrl/tbinsert.cxx b/sc/source/ui/cctrl/tbinsert.cxx
index 07505476aa16..51641e0ce605 100644
--- a/sc/source/ui/cctrl/tbinsert.cxx
+++ b/sc/source/ui/cctrl/tbinsert.cxx
@@ -94,7 +94,7 @@ void __EXPORT ScTbxInsertCtrl::StateChanged( USHORT /* nSID */, SfxItemState eSt
Image aImage = GetImage( m_xFrame,
aSlotURL,
hasBigImages(),
- GetToolBox().GetDisplayBackground().GetColor().IsDark() );
+ GetToolBox().GetSettings().GetStyleSettings().GetHighContrastMode() );
GetToolBox().SetItemImage(GetId(), aImage);
}
}
diff --git a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
index bf957b889d82..bb0e83746050 100644
--- a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
+++ b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
@@ -273,10 +273,10 @@ ScZoomSliderWnd::ScZoomSliderWnd( Window* pParent, const ::com::sun::star::uno::
m_xDispatchProvider( rDispatchProvider ),
m_xFrame( _xFrame )
{
- BOOL bIsDark = GetSettings().GetStyleSettings().GetFaceColor().IsDark();
- mpImpl->maSliderButton = Image( SVX_RES( bIsDark ? RID_SVXBMP_SLIDERBUTTON_HC : RID_SVXBMP_SLIDERBUTTON ) );
- mpImpl->maIncreaseButton = Image( SVX_RES( bIsDark ? RID_SVXBMP_SLIDERINCREASE_HC : RID_SVXBMP_SLIDERINCREASE ) );
- mpImpl->maDecreaseButton = Image( SVX_RES( bIsDark ? RID_SVXBMP_SLIDERDECREASE_HC : RID_SVXBMP_SLIDERDECREASE ) );
+ BOOL bIsHC = GetSettings().GetStyleSettings().GetHighContrastMode();
+ mpImpl->maSliderButton = Image( SVX_RES( bIsHC ? RID_SVXBMP_SLIDERBUTTON_HC : RID_SVXBMP_SLIDERBUTTON ) );
+ mpImpl->maIncreaseButton = Image( SVX_RES( bIsHC ? RID_SVXBMP_SLIDERINCREASE_HC : RID_SVXBMP_SLIDERINCREASE ) );
+ mpImpl->maDecreaseButton = Image( SVX_RES( bIsHC ? RID_SVXBMP_SLIDERDECREASE_HC : RID_SVXBMP_SLIDERDECREASE ) );
Size aSliderSize = LogicToPixel( Size( aLogicalSize), MapMode( MAP_10TH_MM ) );
SetSizePixel( Size( aSliderSize.Width() * nSliderWidth-1, aSliderSize.Height() + nSliderHeight ) );
}
diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx
index 337329acfec6..8bbc561c9e43 100644
--- a/sc/source/ui/dbgui/tpsubt.cxx
+++ b/sc/source/ui/dbgui/tpsubt.cxx
@@ -276,8 +276,8 @@ BOOL ScTpSubTotalGroup::DoFillItemSet( USHORT nGroupNo,
rArgSet.Put( ScSubTotalItem( SCITEM_SUBTDATA, &theSubTotalData ) );
- if ( pSubTotals ) delete pSubTotals;
- if ( pFunctions ) delete pFunctions;
+ if ( pSubTotals ) delete [] pSubTotals;
+ if ( pFunctions ) delete [] pFunctions;
return TRUE;
}
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index fd3a562ecb42..fa00559b4f27 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -172,6 +172,10 @@ void __EXPORT ScAreaLink::Closed()
bAddUndo = FALSE; // nur einmal
}
+ SCTAB nDestTab = aDestArea.aStart.Tab();
+ if (pDoc->IsStreamValid(nDestTab))
+ pDoc->SetStreamValid(nDestTab, FALSE);
+
SvBaseLink::Closed();
}
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index cb5d2ead509f..f9039a88f658 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -3079,6 +3079,9 @@ BOOL ScDocFunc::InsertPageBreak( BOOL bColumn, const ScAddress& rPos,
pDoc->SetRowFlags( static_cast<SCROW>(nPos), nTab, nFlags );
pDoc->UpdatePageBreaks( nTab );
+ if (pDoc->IsStreamValid(nTab))
+ pDoc->SetStreamValid(nTab, FALSE);
+
if (bColumn)
{
rDocShell.PostPaint( static_cast<SCCOL>(nPos)-1, 0, nTab, MAXCOL, MAXROW, nTab, PAINT_GRID );
@@ -3135,6 +3138,9 @@ BOOL ScDocFunc::RemovePageBreak( BOOL bColumn, const ScAddress& rPos,
pDoc->SetRowFlags( static_cast<SCROW>(nPos), nTab, nFlags );
pDoc->UpdatePageBreaks( nTab );
+ if (pDoc->IsStreamValid(nTab))
+ pDoc->SetStreamValid(nTab, FALSE);
+
if (bColumn)
{
rDocShell.PostPaint( static_cast<SCCOL>(nPos)-1, 0, nTab, MAXCOL, MAXROW, nTab, PAINT_GRID );
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index f7d1e2ccae2f..3d1226ae576d 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2390,9 +2390,9 @@ void ScDocShell::SetDrawModified( BOOL bIsModified /* = TRUE */ )
SetModified( bIsModified );
+ SfxBindings* pBindings = GetViewBindings();
if (bUpdate)
{
- SfxBindings* pBindings = GetViewBindings();
if (pBindings)
{
pBindings->Invalidate( SID_SAVEDOC );
@@ -2402,6 +2402,16 @@ void ScDocShell::SetDrawModified( BOOL bIsModified /* = TRUE */ )
if (bIsModified)
{
+ if (pBindings)
+ {
+ // #i105960# Undo etc used to be volatile.
+ // They always have to be invalidated, including drawing layer or row height changes
+ // (but not while pPaintLockData is set).
+ pBindings->Invalidate( SID_UNDO );
+ pBindings->Invalidate( SID_REDO );
+ pBindings->Invalidate( SID_REPEAT );
+ }
+
if ( aDocument.IsChartListenerCollectionNeedsUpdate() )
{
aDocument.UpdateChartListenerCollection();
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index b7c726deeb71..5b2da76475df 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -840,8 +840,9 @@ BOOL ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, BOOL bCopy, BOOL bRec
ScDocShellModificator aModificator( *this );
// #i92477# be consistent with ScDocFunc::InsertTable: any index past the last sheet means "append"
+ // #i101139# nDestTab must be the target position, not APPEND (for CopyTabProtection etc.)
if ( nDestTab >= aDocument.GetTableCount() )
- nDestTab = SC_TAB_APPEND;
+ nDestTab = aDocument.GetTableCount();
if (bCopy)
{
diff --git a/sc/source/ui/docshell/olinefun.cxx b/sc/source/ui/docshell/olinefun.cxx
index 1da178aaa0c2..20ffb63f43fd 100644
--- a/sc/source/ui/docshell/olinefun.cxx
+++ b/sc/source/ui/docshell/olinefun.cxx
@@ -137,6 +137,9 @@ BOOL ScOutlineDocFunc::MakeOutline( const ScRange& rRange, BOOL bColumns, BOOL b
pUndoTab, bColumns, TRUE ) );
}
+ if (pDoc->IsStreamValid(nTab))
+ pDoc->SetStreamValid(nTab, FALSE);
+
USHORT nParts = 0; // Datenbereich nicht geaendert
if ( bColumns )
nParts |= PAINT_TOP;
@@ -200,6 +203,9 @@ BOOL ScOutlineDocFunc::RemoveOutline( const ScRange& rRange, BOOL bColumns, BOOL
pUndoTab, bColumns, FALSE ) );
}
+ if (pDoc->IsStreamValid(nTab))
+ pDoc->SetStreamValid(nTab, FALSE);
+
USHORT nParts = 0; // Datenbereich nicht geaendert
if ( bColumns )
nParts |= PAINT_TOP;
@@ -265,6 +271,9 @@ BOOL ScOutlineDocFunc::RemoveAllOutlines( SCTAB nTab, BOOL bRecord, BOOL bApi )
pDoc->UpdatePageBreaks( nTab );
+ if (pDoc->IsStreamValid(nTab))
+ pDoc->SetStreamValid(nTab, FALSE);
+
rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab,
PAINT_GRID | PAINT_LEFT | PAINT_TOP | PAINT_SIZE );
rDocShell.SetDocumentModified();
@@ -333,6 +342,9 @@ BOOL ScOutlineDocFunc::AutoOutline( const ScRange& rRange, BOOL bRecord, BOOL bA
pUndoDoc, pUndoTab ) );
}
+ if (pDoc->IsStreamValid(nTab))
+ pDoc->SetStreamValid(nTab, FALSE);
+
rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab, PAINT_LEFT | PAINT_TOP | PAINT_SIZE );
rDocShell.SetDocumentModified();
lcl_InvalidateOutliner( rDocShell.GetViewBindings() );
diff --git a/sc/source/ui/inc/privsplt.hxx b/sc/source/ui/inc/privsplt.hxx
index d3b7c9ad96b8..901fa6c87eb9 100644
--- a/sc/source/ui/inc/privsplt.hxx
+++ b/sc/source/ui/inc/privsplt.hxx
@@ -54,6 +54,7 @@ class ScPrivatSplit : public Control
short nDeltaX;
short nDeltaY;
+ using Control::ImplInitSettings;
void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index 9bba01960b32..6e3fbaa86cc0 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -518,23 +518,23 @@ void CommandToolBox::UpdateButtons()
CheckItem( IID_CHANGEROOT, bRootSet );
}
- BOOL bDark = GetDisplayBackground().GetColor().IsDark();
+ BOOL bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
USHORT nImageId = 0;
switch ( rDlg.nDropMode )
{
- case SC_DROPMODE_URL: nImageId = bDark ? RID_IMG_H_DROP_URL : RID_IMG_DROP_URL; break;
- case SC_DROPMODE_LINK: nImageId = bDark ? RID_IMG_H_DROP_LINK : RID_IMG_DROP_LINK; break;
- case SC_DROPMODE_COPY: nImageId = bDark ? RID_IMG_H_DROP_COPY : RID_IMG_DROP_COPY; break;
+ case SC_DROPMODE_URL: nImageId = bHC ? RID_IMG_H_DROP_URL : RID_IMG_DROP_URL; break;
+ case SC_DROPMODE_LINK: nImageId = bHC ? RID_IMG_H_DROP_LINK : RID_IMG_DROP_LINK; break;
+ case SC_DROPMODE_COPY: nImageId = bHC ? RID_IMG_H_DROP_COPY : RID_IMG_DROP_COPY; break;
}
SetItemImage( IID_DROPMODE, Image(ScResId(nImageId)) );
}
void CommandToolBox::InitImageList()
{
- BOOL bDark = GetDisplayBackground().GetColor().IsDark();
+ BOOL bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
- ImageList& rImgLst = bDark ? rDlg.aCmdImageListH : rDlg.aCmdImageList;
+ ImageList& rImgLst = bHC ? rDlg.aCmdImageListH : rDlg.aCmdImageList;
USHORT nCount = GetItemCount();
for (USHORT i = 0; i < nCount; i++)
diff --git a/sc/source/ui/pagedlg/tptable.cxx b/sc/source/ui/pagedlg/tptable.cxx
index e64ef46bef87..b3640f2905c5 100644
--- a/sc/source/ui/pagedlg/tptable.cxx
+++ b/sc/source/ui/pagedlg/tptable.cxx
@@ -171,9 +171,9 @@ ScTablePage::ScTablePage( Window* pParent, const SfxItemSet& rCoreAttrs ) :
void ScTablePage::ShowImage()
{
- bool bDark = GetDisplayBackground().GetColor().IsDark();
+ bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
bool bLeftRight = aBtnLeftRight.IsChecked();
- aBmpPageDir.SetImage( bDark ?
+ aBmpPageDir.SetImage( bHC ?
(bLeftRight ? aImgLeftRightHC : aImgTopDownHC) :
(bLeftRight ? aImgLeftRight : aImgTopDown) );
}
diff --git a/sc/source/ui/unoobj/targuno.cxx b/sc/source/ui/unoobj/targuno.cxx
index 0fed003b751b..f3fcb8c6d671 100644
--- a/sc/source/ui/unoobj/targuno.cxx
+++ b/sc/source/ui/unoobj/targuno.cxx
@@ -248,7 +248,7 @@ void ScLinkTargetTypeObj::SetLinkTargetBitmap( uno::Any& rRet, sal_uInt16 nType
}
if (nImgId)
{
- BOOL bHighContrast = Application::GetSettings().GetStyleSettings().GetWindowColor().IsDark();
+ BOOL bHighContrast = Application::GetSettings().GetStyleSettings().GetHighContrastMode();
ImageList aEntryImages( ScResId( bHighContrast ? RID_IMAGELIST_H_NAVCONT : RID_IMAGELIST_NAVCONT ) );
const Image& rImage = aEntryImages.GetImage( nImgId );
rRet <<= uno::Reference< awt::XBitmap > (VCLUnoHelper::CreateBitmap( rImage.GetBitmapEx() ));
diff --git a/sc/source/ui/view/olinewin.cxx b/sc/source/ui/view/olinewin.cxx
index 5ac563987e65..6e5535361653 100644
--- a/sc/source/ui/view/olinewin.cxx
+++ b/sc/source/ui/view/olinewin.cxx
@@ -167,7 +167,7 @@ void ScOutlineWindow::InitSettings()
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
SetBackground( rStyleSettings.GetFaceColor() );
maLineColor = rStyleSettings.GetButtonTextColor();
- mpSymbols = ScGlobal::GetOutlineSymbols( !!GetBackground().GetColor().IsDark() );
+ mpSymbols = ScGlobal::GetOutlineSymbols( rStyleSettings.GetHighContrastMode() );
Invalidate();
}