diff options
author | Heiko Tietze <tietze.heiko@gmail.com> | 2023-04-13 12:15:46 +0200 |
---|---|---|
committer | Heiko Tietze <heiko.tietze@documentfoundation.org> | 2023-04-14 11:39:06 +0200 |
commit | 11bb9c14da13507adeeea8dce863fb4b96a92870 (patch) | |
tree | 77731313a7a4630a807a55393d7132e9dda512c3 /sc/source | |
parent | b9ad48f1939145105ee57470b5c9210bacc8ee45 (diff) |
[API CHANGE] Related tdf#154080 - Allow customization of comment indicator color
* Calc > View option replaced by a new application color
* Border not only in highcontrast mode but always shown
* Border color depending on cell/sheet background
The previous option TextOverflow in Calc.xcs was replaced by
CalcTextOverflow in UI.xcs in order to combine color and on/off
with the accepted drawback of incompatibility.
The alternative, keeping the color separate from the toggle, would
separate the options and was rejected therefore.
Change-Id: Ie3e469163485d8eb1cffc7022e1518ad20e8e54e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150340
Tested-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/tool/viewopti.cxx | 15 | ||||
-rw-r--r-- | sc/source/ui/inc/tpview.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/optdlg/tpview.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/output.cxx | 17 | ||||
-rw-r--r-- | sc/source/ui/view/tabview3.cxx | 2 |
6 files changed, 13 insertions, 30 deletions
diff --git a/sc/source/core/tool/viewopti.cxx b/sc/source/core/tool/viewopti.cxx index f243289653cd..ad09d7ea70f4 100644 --- a/sc/source/core/tool/viewopti.cxx +++ b/sc/source/core/tool/viewopti.cxx @@ -105,7 +105,6 @@ void ScViewOptions::SetDefaults() aOptArr[ VOPT_GRID ] = true; aOptArr[ VOPT_ANCHOR ] = true; aOptArr[ VOPT_PAGEBREAKS ] = true; - aOptArr[ VOPT_CLIPMARKS ] = true; aOptArr[ VOPT_SUMMARY ] = true; aOptArr[ VOPT_THEMEDCURSOR ] = false; @@ -212,10 +211,9 @@ constexpr OUStringLiteral CFGPATH_DISPLAY = u"Office.Calc/Content/Display"; #define SCDISPLAYOPT_FORMULAMARK 3 #define SCDISPLAYOPT_VALUEHI 4 #define SCDISPLAYOPT_ANCHOR 5 -#define SCDISPLAYOPT_TEXTOVER 6 -#define SCDISPLAYOPT_OBJECTGRA 7 -#define SCDISPLAYOPT_CHART 8 -#define SCDISPLAYOPT_DRAWING 9 +#define SCDISPLAYOPT_OBJECTGRA 6 +#define SCDISPLAYOPT_CHART 7 +#define SCDISPLAYOPT_DRAWING 8 constexpr OUStringLiteral CFGPATH_GRID = u"Office.Calc/Grid"; @@ -254,7 +252,6 @@ Sequence<OUString> ScViewCfg::GetDisplayPropertyNames() "FormulaMark", // SCDISPLAYOPT_FORMULAMARK "ValueHighlighting", // SCDISPLAYOPT_VALUEHI "Anchor", // SCDISPLAYOPT_ANCHOR - "TextOverflow", // SCDISPLAYOPT_TEXTOVER "ObjectGraphic", // SCDISPLAYOPT_OBJECTGRA "Chart", // SCDISPLAYOPT_CHART "DrawingObject"}; // SCDISPLAYOPT_DRAWING; @@ -379,9 +376,6 @@ ScViewCfg::ScViewCfg() : case SCDISPLAYOPT_ANCHOR: SetOption( VOPT_ANCHOR, ScUnoHelpFunctions::GetBoolFromAny( pValues[nProp] ) ); break; - case SCDISPLAYOPT_TEXTOVER: - SetOption( VOPT_CLIPMARKS, ScUnoHelpFunctions::GetBoolFromAny( pValues[nProp] ) ); - break; case SCDISPLAYOPT_OBJECTGRA: if ( pValues[nProp] >>= nIntVal ) { @@ -547,9 +541,6 @@ IMPL_LINK_NOARG(ScViewCfg, DisplayCommitHdl, ScLinkConfigItem&, void) case SCDISPLAYOPT_ANCHOR: pValues[nProp] <<= GetOption( VOPT_ANCHOR ); break; - case SCDISPLAYOPT_TEXTOVER: - pValues[nProp] <<= GetOption( VOPT_CLIPMARKS ); - break; case SCDISPLAYOPT_OBJECTGRA: pValues[nProp] <<= static_cast<sal_Int32>(GetObjMode( VOBJ_TYPE_OLE )); break; diff --git a/sc/source/ui/inc/tpview.hxx b/sc/source/ui/inc/tpview.hxx index ad485b361580..bce6fc28b040 100644 --- a/sc/source/ui/inc/tpview.hxx +++ b/sc/source/ui/inc/tpview.hxx @@ -38,7 +38,6 @@ class ScTpContentOptions : public SfxTabPage std::unique_ptr<weld::CheckButton> m_xFormulaMarkCB; std::unique_ptr<weld::CheckButton> m_xValueCB; std::unique_ptr<weld::CheckButton> m_xAnchorCB; - std::unique_ptr<weld::CheckButton> m_xClipMarkCB; std::unique_ptr<weld::CheckButton> m_xRangeFindCB; std::unique_ptr<weld::ComboBox> m_xObjGrfLB; diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx index f83ce9f033a5..982e9dc1c125 100644 --- a/sc/source/ui/optdlg/tpview.cxx +++ b/sc/source/ui/optdlg/tpview.cxx @@ -43,7 +43,6 @@ ScTpContentOptions::ScTpContentOptions(weld::Container* pPage, weld::DialogContr , m_xFormulaMarkCB(m_xBuilder->weld_check_button("formulamark")) , m_xValueCB(m_xBuilder->weld_check_button("value")) , m_xAnchorCB(m_xBuilder->weld_check_button("anchor")) - , m_xClipMarkCB(m_xBuilder->weld_check_button("clipmark")) , m_xRangeFindCB(m_xBuilder->weld_check_button("rangefind")) , m_xObjGrfLB(m_xBuilder->weld_combo_box("objgrf")) , m_xDiagramLB(m_xBuilder->weld_combo_box("diagram")) @@ -73,7 +72,6 @@ ScTpContentOptions::ScTpContentOptions(weld::Container* pPage, weld::DialogContr m_xFormulaMarkCB->connect_toggled(aCBHdl); m_xValueCB->connect_toggled(aCBHdl); m_xAnchorCB->connect_toggled(aCBHdl); - m_xClipMarkCB->connect_toggled(aCBHdl); m_xVScrollCB->connect_toggled(aCBHdl); m_xHScrollCB->connect_toggled(aCBHdl); @@ -105,7 +103,6 @@ bool ScTpContentOptions::FillItemSet( SfxItemSet* rCoreSet ) m_xFormulaMarkCB->get_state_changed_from_saved() || m_xValueCB->get_state_changed_from_saved() || m_xAnchorCB->get_state_changed_from_saved() || - m_xClipMarkCB->get_state_changed_from_saved() || m_xObjGrfLB->get_value_changed_from_saved() || m_xDiagramLB->get_value_changed_from_saved() || m_xDrawLB->get_value_changed_from_saved() || @@ -149,7 +146,6 @@ void ScTpContentOptions::Reset( const SfxItemSet* rCoreSet ) m_xFormulaMarkCB->set_active(m_xLocalOptions->GetOption(VOPT_FORMULAS_MARKS)); m_xValueCB ->set_active(m_xLocalOptions->GetOption(VOPT_SYNTAX)); m_xAnchorCB ->set_active(m_xLocalOptions->GetOption(VOPT_ANCHOR)); - m_xClipMarkCB->set_active(m_xLocalOptions->GetOption(VOPT_CLIPMARKS)); m_xObjGrfLB ->set_active( static_cast<sal_uInt16>(m_xLocalOptions->GetObjMode(VOBJ_TYPE_OLE)) ); m_xDiagramLB ->set_active( static_cast<sal_uInt16>(m_xLocalOptions->GetObjMode(VOBJ_TYPE_CHART)) ); @@ -185,7 +181,6 @@ void ScTpContentOptions::Reset( const SfxItemSet* rCoreSet ) m_xFormulaMarkCB->save_state(); m_xValueCB->save_state(); m_xAnchorCB->save_state(); - m_xClipMarkCB->save_state(); m_xObjGrfLB->save_value(); m_xDiagramLB->save_value(); m_xDrawLB->save_value(); @@ -239,7 +234,6 @@ IMPL_LINK( ScTpContentOptions, CBHdl, weld::Toggleable&, rBtn, void ) else if ( m_xFormulaMarkCB.get() == &rBtn ) eOption = VOPT_FORMULAS_MARKS; else if ( m_xValueCB.get() == &rBtn ) eOption = VOPT_SYNTAX; else if ( m_xAnchorCB.get() == &rBtn ) eOption = VOPT_ANCHOR; - else if ( m_xClipMarkCB.get() == &rBtn ) eOption = VOPT_CLIPMARKS; else if ( m_xVScrollCB.get() == &rBtn ) eOption = VOPT_VSCROLL; else if ( m_xHScrollCB.get() == &rBtn ) eOption = VOPT_HSCROLL; else if ( m_xTblRegCB.get() == &rBtn ) eOption = VOPT_TABCONTROLS; diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index e4e8f1af3696..fa78ad78312e 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -703,7 +703,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI aOutputData.SetShowNullValues ( rOpts.GetOption( VOPT_NULLVALS ) ); aOutputData.SetShowFormulas ( rOpts.GetOption( VOPT_FORMULAS ) ); aOutputData.SetShowSpellErrors ( rDoc.GetDocOptions().IsAutoSpell() ); - aOutputData.SetMarkClipped ( rOpts.GetOption( VOPT_CLIPMARKS ) ); + aOutputData.SetMarkClipped ( SC_MOD()->GetColorConfig().GetColorValue(svtools::CALCTEXTOVERFLOW).bIsVisible ); aOutputData.SetUseStyleColor( true ); // always set in table view diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 14227020e70f..d00f222b0f75 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -2613,17 +2613,10 @@ void ScOutputData::DrawClipMarks() if (!bAnyClipped) return; - Color aArrowFillCol( COL_LIGHTRED ); + Color aArrowFillCol( SC_MOD()->GetColorConfig().GetColorValue(svtools::CALCTEXTOVERFLOW).nColor ); + const bool bIsDarkBackground = SC_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor.IsDark(); DrawModeFlags nOldDrawMode = mpDev->GetDrawMode(); - const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); - if ( mbUseStyleColor && rStyleSettings.GetHighContrastMode() ) - { - // use DrawMode to change the arrow's outline color - mpDev->SetDrawMode( nOldDrawMode | DrawModeFlags::SettingsLine ); - // use text color also for the fill color - aArrowFillCol = SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor; - } tools::Long nInitPosX = nScrX; if ( bLayoutRTL ) @@ -2716,6 +2709,12 @@ void ScOutputData::DrawClipMarks() tools::Long nMarkPixel = static_cast<tools::Long>( SC_CLIPMARK_SIZE * mnPPTX ); Size aMarkSize( nMarkPixel, (nMarkPixel-1)*2 ); + const Color aColor = pInfo->pBackground->GetColor(); + if ( aColor == COL_AUTO ? bIsDarkBackground : aColor.IsDark() ) + mpDev->SetDrawMode( nOldDrawMode | DrawModeFlags::WhiteLine ); + else + mpDev->SetDrawMode( nOldDrawMode | DrawModeFlags::BlackLine ); + if (bVertical) { if (pInfo->nClipMark & (bLayoutRTL ? ScClipMark::Bottom : ScClipMark::Top)) diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index dfcd059089e8..395d959839d3 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -2430,7 +2430,7 @@ void ScTabView::PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCRO aStart.AdjustX( -nLayoutSign ); // include change marks aStart.AdjustY( -1 ); - bool bMarkClipped = aViewData.GetOptions().GetOption( VOPT_CLIPMARKS ); + bool bMarkClipped = SC_MOD()->GetColorConfig().GetColorValue(svtools::CALCTEXTOVERFLOW).bIsVisible; if (bMarkClipped) { // ScColumn::IsEmptyData has to be optimized for this |