[Libreoffice-commits] core.git: sc/source
Noel (via logerrit)
logerrit at kemper.freedesktop.org
Mon Oct 26 13:59:09 UTC 2020
sc/source/ui/inc/output.hxx | 7 ++++---
sc/source/ui/view/output.cxx | 8 ++++----
sc/source/ui/view/output2.cxx | 12 ++++++------
3 files changed, 14 insertions(+), 13 deletions(-)
New commits:
commit f74bf51d9cdfc64b72434d062a67dba65eaf7447
Author: Noel <noelgrandin at gmail.com>
AuthorDate: Mon Oct 26 10:30:46 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Oct 26 14:58:23 2020 +0100
std::unique_ptr -> std::optional
Change-Id: Ib3a901c26874bb6e6b7deacca359cefacbb0a3e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104798
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx
index a5de8bbac213..a1e5d6661135 100644
--- a/sc/source/ui/inc/output.hxx
+++ b/sc/source/ui/inc/output.hxx
@@ -28,6 +28,7 @@
#include <editeng/svxenum.hxx>
#include <vcl/outdev.hxx>
#include <o3tl/deleter.hxx>
+#include <optional>
namespace sc {
struct SpellCheckContext;
@@ -216,9 +217,9 @@ private:
bool mbForceAutoColor;
bool mbSyntaxMode; // Syntax highlighting
- std::unique_ptr<Color> pValueColor;
- std::unique_ptr<Color> pTextColor;
- std::unique_ptr<Color> pFormulaColor;
+ std::optional<Color> mxValueColor;
+ std::optional<Color> mxTextColor;
+ std::optional<Color> mxFormulaColor;
Color aGridColor;
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index c44ae0e2c095..4a9c035d16a2 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -277,12 +277,12 @@ void ScOutputData::SetMetaFileMode( bool bNewMode )
void ScOutputData::SetSyntaxMode( bool bNewMode )
{
mbSyntaxMode = bNewMode;
- if ( bNewMode && !pValueColor )
+ if ( bNewMode && !mxValueColor )
{
const svtools::ColorConfig& rColorCfg = SC_MOD()->GetColorConfig();
- pValueColor.reset( new Color( rColorCfg.GetColorValue( svtools::CALCVALUE ).nColor ) );
- pTextColor.reset( new Color( rColorCfg.GetColorValue( svtools::CALCTEXT ).nColor ) );
- pFormulaColor.reset( new Color( rColorCfg.GetColorValue( svtools::CALCFORMULA ).nColor ) );
+ mxValueColor = rColorCfg.GetColorValue( svtools::CALCVALUE ).nColor;
+ mxTextColor = rColorCfg.GetColorValue( svtools::CALCTEXT ).nColor;
+ mxFormulaColor = rColorCfg.GetColorValue( svtools::CALCFORMULA ).nColor;
}
}
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 50fbbd2070c1..564221da4ade 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -864,13 +864,13 @@ void ScOutputData::SetSyntaxColor( vcl::Font* pFont, const ScRefCellValue& rCell
switch (rCell.meType)
{
case CELLTYPE_VALUE:
- pFont->SetColor(*pValueColor);
+ pFont->SetColor(*mxValueColor);
break;
case CELLTYPE_STRING:
- pFont->SetColor(*pTextColor);
+ pFont->SetColor(*mxTextColor);
break;
case CELLTYPE_FORMULA:
- pFont->SetColor(*pFormulaColor);
+ pFont->SetColor(*mxFormulaColor);
break;
default:
{
@@ -894,13 +894,13 @@ void ScOutputData::SetEditSyntaxColor( EditEngine& rEngine, const ScRefCellValue
switch (rCell.meType)
{
case CELLTYPE_VALUE:
- aColor = *pValueColor;
+ aColor = *mxValueColor;
break;
case CELLTYPE_STRING:
- aColor = *pTextColor;
+ aColor = *mxTextColor;
break;
case CELLTYPE_FORMULA:
- aColor = *pFormulaColor;
+ aColor = *mxFormulaColor;
break;
default:
{
More information about the Libreoffice-commits
mailing list