summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-02-21 07:26:06 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-02-21 14:50:28 +0100
commit9ad252b2e79576119c2d733a1a45fdd9e9f83140 (patch)
tree87fee16145d457b6799a05c389d85270476f7f35 /sc/source/ui
parent3aca35f1505fa552eaa316a2d47a60ef52646525 (diff)
Drop o3tl::optional wrapper
...now that macOS builds are guaranteed to have std::optional since 358146bbbd1b9775c12770fb5e497b6ec5adfc51 "Bump macOS build baseline to Xcode 11.3 and macOS 10.14.4". The change is done mostly mechanically with > for i in $(git grep -Fl optional); do > sed -i -e 's:<o3tl/optional\.hxx>\|\"o3tl/optional\.hxx\":<optional>:' \ > -e 's/\<o3tl::optional\>/std::optional/g' \ > -e 's/\<o3tl::make_optional\>/std::make_optional/g' "$i" > done > for i in $(git grep -Flw o3tl::nullopt); do > sed -i -e 's/\<o3tl::nullopt\>/std::nullopt/g' "$i" > done (though that causes some of the resulting #include <optional> to appear at different places relative to other includes than if they had been added manually), plus a few manual modifications: * adapt bin/find-unneeded-includes * adapt desktop/IwyuFilter_desktop.yaml * remove include/o3tl/optional.hxx * quote resulting "<"/">" as "&lt;"/"&gt;" in officecfg/registry/cppheader.xsl * and then solenv/clang-format/reformat-formatted-files Change-Id: I68833d9f7945e57aa2bc703349cbc5a56b342273 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89165 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocument.cxx16
-rw-r--r--sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx4
-rw-r--r--sc/source/ui/dbgui/pvfundlg.cxx2
-rw-r--r--sc/source/ui/inc/RandomNumberGeneratorDialog.hxx4
-rw-r--r--sc/source/ui/inc/gridwin.hxx2
-rw-r--r--sc/source/ui/pagedlg/scuitphfedit.cxx4
-rw-r--r--sc/source/ui/unoobj/dapiuno.cxx4
-rw-r--r--sc/source/ui/unoobj/fielduno.cxx4
-rw-r--r--sc/source/ui/view/dbfunc3.cxx2
-rw-r--r--sc/source/ui/view/output.cxx14
10 files changed, 28 insertions, 28 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index f5a0ecd3d6b9..9601a8637a3b 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -93,13 +93,13 @@ struct ScAccessibleShapeData
ScAccessibleShapeData(css::uno::Reference< css::drawing::XShape > xShape_);
~ScAccessibleShapeData();
mutable rtl::Reference< ::accessibility::AccessibleShape > pAccShape;
- mutable o3tl::optional<ScAddress> xRelationCell; // if it is NULL this shape is anchored on the table
+ mutable std::optional<ScAddress> xRelationCell; // if it is NULL this shape is anchored on the table
css::uno::Reference< css::drawing::XShape > xShape;
mutable bool bSelected;
bool bSelectable;
// cache these to make the sorting cheaper
- o3tl::optional<sal_Int16> mxLayerID;
- o3tl::optional<sal_Int32> mxZOrder;
+ std::optional<sal_Int16> mxLayerID;
+ std::optional<sal_Int32> mxZOrder;
};
}
@@ -270,7 +270,7 @@ private:
void FillShapes(std::vector < uno::Reference < drawing::XShape > >& rShapes) const;
bool FindSelectedShapesChanges(const css::uno::Reference<css::drawing::XShapes>& xShapes) const;
- o3tl::optional<ScAddress> GetAnchor(const uno::Reference<drawing::XShape>& xShape) const;
+ std::optional<ScAddress> GetAnchor(const uno::Reference<drawing::XShape>& xShape) const;
uno::Reference<XAccessibleRelationSet> GetRelationSet(const ScAccessibleShapeData* pData) const;
void SetAnchor(const uno::Reference<drawing::XShape>& xShape, ScAccessibleShapeData* pData) const;
void AddShape(const uno::Reference<drawing::XShape>& xShape, bool bCommitChange) const;
@@ -1118,7 +1118,7 @@ bool ScChildrenShapes::FindSelectedShapesChanges(const uno::Reference<drawing::X
return bResult;
}
-o3tl::optional<ScAddress> ScChildrenShapes::GetAnchor(const uno::Reference<drawing::XShape>& xShape) const
+std::optional<ScAddress> ScChildrenShapes::GetAnchor(const uno::Reference<drawing::XShape>& xShape) const
{
if (mpViewShell)
{
@@ -1129,12 +1129,12 @@ o3tl::optional<ScAddress> ScChildrenShapes::GetAnchor(const uno::Reference<drawi
if (SdrObject *pSdrObj = pShapeImp->GetSdrObject())
{
if (ScDrawObjData *pAnchor = ScDrawLayer::GetObjData(pSdrObj))
- return o3tl::optional<ScAddress>(pAnchor->maStart);
+ return std::optional<ScAddress>(pAnchor->maStart);
}
}
}
- return o3tl::optional<ScAddress>();
+ return std::optional<ScAddress>();
}
uno::Reference<XAccessibleRelationSet> ScChildrenShapes::GetRelationSet(const ScAccessibleShapeData* pData) const
@@ -1170,7 +1170,7 @@ void ScChildrenShapes::SetAnchor(const uno::Reference<drawing::XShape>& xShape,
{
if (pData)
{
- o3tl::optional<ScAddress> xAddress = GetAnchor(xShape);
+ std::optional<ScAddress> xAddress = GetAnchor(xShape);
if ((xAddress && pData->xRelationCell && (*xAddress != *(pData->xRelationCell))) ||
(!xAddress && pData->xRelationCell) || (xAddress && !pData->xRelationCell))
{
diff --git a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
index 4bb3f1fee9dd..9127f879d17a 100644
--- a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
@@ -175,7 +175,7 @@ void ScRandomNumberGeneratorDialog::SelectGeneratorAndGenerateNumbers()
double parameter1 = parameterInteger1 / static_cast<double>(PRECISION);
double parameter2 = parameterInteger2 / static_cast<double>(PRECISION);
- o3tl::optional<sal_Int8> aDecimalPlaces;
+ std::optional<sal_Int8> aDecimalPlaces;
if (mxEnableRounding->get_active())
{
aDecimalPlaces = static_cast<sal_Int8>(mxDecimalPlaces->get_value());
@@ -250,7 +250,7 @@ void ScRandomNumberGeneratorDialog::SelectGeneratorAndGenerateNumbers()
}
template<class RNG>
-void ScRandomNumberGeneratorDialog::GenerateNumbers(RNG& randomGenerator, const char* pDistributionStringId, o3tl::optional<sal_Int8> aDecimalPlaces)
+void ScRandomNumberGeneratorDialog::GenerateNumbers(RNG& randomGenerator, const char* pDistributionStringId, std::optional<sal_Int8> aDecimalPlaces)
{
OUString aUndo = ScResId(STR_UNDO_DISTRIBUTION_TEMPLATE);
OUString aDistributionName = ScResId(pDistributionStringId);
diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx
index 3d03cf867b4e..e73bcc4c8085 100644
--- a/sc/source/ui/dbgui/pvfundlg.cxx
+++ b/sc/source/ui/dbgui/pvfundlg.cxx
@@ -868,7 +868,7 @@ ScDPShowDetailDlg::ScDPShowDetailDlg(weld::Window* pParent, ScDPObject& rDPObj,
{
if (pDimension)
{
- const o3tl::optional<OUString> & pLayoutName = pDimension->GetLayoutName();
+ const std::optional<OUString> & pLayoutName = pDimension->GetLayoutName();
if (pLayoutName)
aName = *pLayoutName;
}
diff --git a/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx b/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx
index ff2fbd1f6351..32b26505db12 100644
--- a/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx
+++ b/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx
@@ -13,7 +13,7 @@
#include <sal/config.h>
-#include <o3tl/optional.hxx>
+#include <optional>
#include <address.hxx>
#include "anyrefdg.hxx"
@@ -63,7 +63,7 @@ private:
template<class RNG>
- void GenerateNumbers(RNG& randomGenerator, const char* pDistributionStringId, const o3tl::optional<sal_Int8> aDecimalPlaces);
+ void GenerateNumbers(RNG& randomGenerator, const char* pDistributionStringId, const std::optional<sal_Int8> aDecimalPlaces);
void SelectGeneratorAndGenerateNumbers();
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index f66e419ebc9c..c46c01dda25c 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -104,7 +104,7 @@ class SAL_DLLPUBLIC_RTTI ScGridWindow : public vcl::Window, public DropTargetHel
std::unique_ptr<sdr::overlay::OverlayObjectList> mpOOHeader;
std::unique_ptr<sdr::overlay::OverlayObjectList> mpOOShrink;
- o3tl::optional<tools::Rectangle> mpAutoFillRect;
+ std::optional<tools::Rectangle> mpAutoFillRect;
/// LibreOfficeKit needs a persistent FmFormView for tiled rendering,
/// otherwise the invalidations from drawinglayer do not work.
diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx
index af74df3d718e..638ed247be6c 100644
--- a/sc/source/ui/pagedlg/scuitphfedit.cxx
+++ b/sc/source/ui/pagedlg/scuitphfedit.cxx
@@ -183,8 +183,8 @@ void ScHFEditPage::InitPreDefinedList()
{
SvtUserOptions aUserOpt;
- o3tl::optional<Color> pTxtColour;
- o3tl::optional<Color> pFldColour;
+ std::optional<Color> pTxtColour;
+ std::optional<Color> pFldColour;
// Get the all field values at the outset.
OUString aPageFieldValue(m_xWndLeft->GetEditEngine()->CalcFieldValue(SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), 0,0, pTxtColour, pFldColour));
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index c17908803c50..ad174f970127 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -873,7 +873,7 @@ Any SAL_CALL ScDataPilotDescriptorBase::getPropertyValue( const OUString& aPrope
}
else if ( aPropertyName == SC_UNO_DP_GRANDTOTAL_NAME )
{
- const o3tl::optional<OUString> & pGrandTotalName = aNewData.GetGrandTotalName();
+ const std::optional<OUString> & pGrandTotalName = aNewData.GetGrandTotalName();
if (pGrandTotalName)
aRet <<= *pGrandTotalName; // same behavior as in ScDPSource
}
@@ -1672,7 +1672,7 @@ OUString SAL_CALL ScDataPilotFieldObj::getName()
aName = SC_DATALAYOUT_NAME;
else
{
- const o3tl::optional<OUString> & pLayoutName = pDim->GetLayoutName();
+ const std::optional<OUString> & pLayoutName = pDim->GetLayoutName();
if (pLayoutName)
aName = *pLayoutName;
else
diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx
index fcb986514ef8..5cf63e574936 100644
--- a/sc/source/ui/unoobj/fielduno.cxx
+++ b/sc/source/ui/unoobj/fielduno.cxx
@@ -177,7 +177,7 @@ public:
explicit ScUnoEditEngine(ScEditEngineDefaulter* pSource);
virtual OUString CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos,
- o3tl::optional<Color>& rTxtColor, o3tl::optional<Color>& rFldColor ) override;
+ std::optional<Color>& rTxtColor, std::optional<Color>& rFldColor ) override;
sal_uInt16 CountFields();
SvxFieldData* FindByIndex(sal_uInt16 nIndex);
@@ -203,7 +203,7 @@ ScUnoEditEngine::ScUnoEditEngine(ScEditEngineDefaulter* pSource)
}
OUString ScUnoEditEngine::CalcFieldValue( const SvxFieldItem& rField,
- sal_Int32 nPara, sal_Int32 nPos, o3tl::optional<Color>& rTxtColor, o3tl::optional<Color>& rFldColor )
+ sal_Int32 nPara, sal_Int32 nPos, std::optional<Color>& rTxtColor, std::optional<Color>& rFldColor )
{
OUString aRet(EditEngine::CalcFieldValue( rField, nPara, nPos, rTxtColor, rFldColor ));
if (eMode != SC_UNO_COLLECT_NONE)
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 0a76a774fa8e..2ca08843fd42 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -1541,7 +1541,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const OUString& rString )
if (pDim->GetSubTotalFunc(0) != ScGeneralFunction::AUTO)
break;
- const o3tl::optional<OUString> & pLayoutName = pMem->GetLayoutName();
+ const std::optional<OUString> & pLayoutName = pMem->GetLayoutName();
OUString aMemberName;
if (pLayoutName)
aMemberName = *pLayoutName;
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 35cd545b2a6e..8683ecdadf77 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -774,8 +774,8 @@ static bool lcl_EqualBack( const RowInfo& rFirst, const RowInfo& rOther,
for ( nX=nX1; nX<=nX2; nX++ )
{
- o3tl::optional<Color> const & pCol1 = rFirst.pCellInfo[nX+1].mxColorScale;
- o3tl::optional<Color> const & pCol2 = rOther.pCellInfo[nX+1].mxColorScale;
+ std::optional<Color> const & pCol1 = rFirst.pCellInfo[nX+1].mxColorScale;
+ std::optional<Color> const & pCol2 = rOther.pCellInfo[nX+1].mxColorScale;
if( (pCol1 && !pCol2) || (!pCol1 && pCol2) )
return false;
@@ -909,7 +909,7 @@ void drawIconSets(vcl::RenderContext& rRenderContext, const ScIconSetInfo* pOldI
rRenderContext.DrawBitmapEx( Point( rRect.Left() + 2 * nOneX, rRect.Top() + 2 * nOneY), Size(aOrigSize, aOrigSize), rIcon );
}
-void drawCells(vcl::RenderContext& rRenderContext, o3tl::optional<Color> const & pColor, const SvxBrushItem* pBackground, o3tl::optional<Color>& pOldColor, const SvxBrushItem*& pOldBackground,
+void drawCells(vcl::RenderContext& rRenderContext, std::optional<Color> const & pColor, const SvxBrushItem* pBackground, std::optional<Color>& pOldColor, const SvxBrushItem*& pOldBackground,
tools::Rectangle& rRect, long nPosX, long nLayoutSign, long nOneX, long nOneY, const ScDataBarInfo* pDataBarInfo, const ScDataBarInfo*& pOldDataBarInfo,
const ScIconSetInfo* pIconSetInfo, const ScIconSetInfo*& pOldIconSetInfo,
sc::IconSetBitmapMap & rIconSetBitmapMap)
@@ -1059,7 +1059,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext)
const SvxBrushItem* pOldBackground = nullptr;
const SvxBrushItem* pBackground = nullptr;
- o3tl::optional<Color> pOldColor;
+ std::optional<Color> pOldColor;
const ScDataBarInfo* pOldDataBarInfo = nullptr;
const ScIconSetInfo* pOldIconSetInfo = nullptr;
SCCOL nMergedCols = 1;
@@ -1104,7 +1104,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext)
pBackground = lcl_FindBackground( mpDoc, nX, nY, nTab );
}
- o3tl::optional<Color> const & pColor = pInfo->mxColorScale;
+ std::optional<Color> const & pColor = pInfo->mxColorScale;
const ScDataBarInfo* pDataBarInfo = pInfo->pDataBar.get();
const ScIconSetInfo* pIconSetInfo = pInfo->pIconSet.get();
@@ -1136,7 +1136,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext)
if (bWorksInPixels)
nPosXLogic = rRenderContext.PixelToLogic(Point(nPosX, 0)).X();
- drawCells(rRenderContext, o3tl::optional<Color>(), nullptr, pOldColor, pOldBackground, aRect, nPosXLogic, nLayoutSign, nOneXLogic, nOneYLogic, nullptr, pOldDataBarInfo, nullptr, pOldIconSetInfo, mpDoc->GetIconSetBitmapMap());
+ drawCells(rRenderContext, std::optional<Color>(), nullptr, pOldColor, pOldBackground, aRect, nPosXLogic, nLayoutSign, nOneXLogic, nOneYLogic, nullptr, pOldDataBarInfo, nullptr, pOldIconSetInfo, mpDoc->GetIconSetBitmapMap());
nArrY += nSkip;
}
@@ -1650,7 +1650,7 @@ void ScOutputData::DrawRotatedFrame(vcl::RenderContext& rRenderContext)
else
{
tools::Polygon aPoly(4, aPoints);
- o3tl::optional<Color> const & pColor = pInfo->mxColorScale;
+ std::optional<Color> const & pColor = pInfo->mxColorScale;
// for DrawPolygon, without Pen one pixel is left out
// to the right and below...