ScConditionalFormat: pass ScDocument by ref
and in other related places Change-Id: Ic4fd970c0f91f246893013f0751376043dd809f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185361 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
This commit is contained in:
+11
-11
@@ -58,7 +58,7 @@ public:
|
||||
ScConditionMode eMode = ScConditionMode::EqGreater);
|
||||
SC_DLLPUBLIC ScColorScaleEntry();
|
||||
ScColorScaleEntry(const ScColorScaleEntry& rEntry);
|
||||
ScColorScaleEntry(ScDocument* pDoc, const ScColorScaleEntry& rEntry);
|
||||
ScColorScaleEntry(ScDocument& rDoc, const ScColorScaleEntry& rEntry);
|
||||
SC_DLLPUBLIC ~ScColorScaleEntry() COVERITY_NOEXCEPT_FALSE;
|
||||
|
||||
const Color& GetColor() const { return maColor;}
|
||||
@@ -225,7 +225,7 @@ struct ScIconSetMap {
|
||||
class SAL_DLLPUBLIC_RTTI ScColorFormat : public ScFormatEntry
|
||||
{
|
||||
public:
|
||||
ScColorFormat(ScDocument* pDoc);
|
||||
ScColorFormat(ScDocument& rDoc);
|
||||
SC_DLLPUBLIC virtual ~ScColorFormat() override;
|
||||
|
||||
SC_DLLPUBLIC const ScRangeList& GetRange() const;
|
||||
@@ -260,13 +260,13 @@ private:
|
||||
void calcMinMax(double& nMin, double& nMax) const;
|
||||
double CalcValue(double nMin, double nMax, const ScColorScaleEntries::const_iterator& rItr) const;
|
||||
public:
|
||||
SC_DLLPUBLIC ScColorScaleFormat(ScDocument* pDoc);
|
||||
ScColorScaleFormat(ScDocument* pDoc, const ScColorScaleFormat& rFormat);
|
||||
SC_DLLPUBLIC ScColorScaleFormat(ScDocument& rDoc);
|
||||
ScColorScaleFormat(ScDocument& rDoc, const ScColorScaleFormat& rFormat);
|
||||
ScColorScaleFormat(const ScColorScaleFormat&) = delete;
|
||||
virtual ~ScColorScaleFormat() override;
|
||||
const ScColorScaleFormat& operator=(const ScColorScaleFormat&) = delete;
|
||||
|
||||
virtual ScColorFormat* Clone(ScDocument* pDoc) const override;
|
||||
virtual ScColorFormat* Clone(ScDocument& rDoc) const override;
|
||||
|
||||
virtual void SetParent(ScConditionalFormat* pParent) override;
|
||||
|
||||
@@ -301,9 +301,9 @@ public:
|
||||
class SAL_DLLPUBLIC_RTTI ScDataBarFormat final : public ScColorFormat
|
||||
{
|
||||
public:
|
||||
SC_DLLPUBLIC ScDataBarFormat(ScDocument* pDoc);
|
||||
ScDataBarFormat(ScDocument* pDoc, const ScDataBarFormat& rFormat);
|
||||
virtual ScColorFormat* Clone(ScDocument* pDoc) const override;
|
||||
SC_DLLPUBLIC ScDataBarFormat(ScDocument& rDoc);
|
||||
ScDataBarFormat(ScDocument& rDoc, const ScDataBarFormat& rFormat);
|
||||
virtual ScColorFormat* Clone(ScDocument& rDoc) const override;
|
||||
|
||||
virtual void SetParent(ScConditionalFormat* pParent) override;
|
||||
|
||||
@@ -364,10 +364,10 @@ struct ScIconSetFormatData
|
||||
class SAL_DLLPUBLIC_RTTI ScIconSetFormat final : public ScColorFormat
|
||||
{
|
||||
public:
|
||||
SC_DLLPUBLIC ScIconSetFormat(ScDocument* pDoc);
|
||||
ScIconSetFormat(ScDocument* pDoc, const ScIconSetFormat& rFormat);
|
||||
SC_DLLPUBLIC ScIconSetFormat(ScDocument& rDoc);
|
||||
ScIconSetFormat(ScDocument& rDoc, const ScIconSetFormat& rFormat);
|
||||
|
||||
virtual ScColorFormat* Clone(ScDocument* pDoc) const override;
|
||||
virtual ScColorFormat* Clone(ScDocument& rDoc) const override;
|
||||
|
||||
virtual void SetParent(ScConditionalFormat* pParent) override;
|
||||
|
||||
|
||||
+12
-12
@@ -225,7 +225,7 @@ struct SC_DLLPUBLIC ScCondFormatData
|
||||
class SC_DLLPUBLIC ScFormatEntry
|
||||
{
|
||||
public:
|
||||
ScFormatEntry(ScDocument* pDoc);
|
||||
ScFormatEntry(ScDocument& rDoc);
|
||||
virtual ~ScFormatEntry() {}
|
||||
|
||||
enum class Type
|
||||
@@ -244,7 +244,7 @@ public:
|
||||
virtual void UpdateDeleteTab( sc::RefUpdateDeleteTabContext& rCxt ) = 0;
|
||||
virtual void UpdateMoveTab( sc::RefUpdateMoveTabContext& rCxt ) = 0;
|
||||
|
||||
virtual ScFormatEntry* Clone( ScDocument* pDoc ) const = 0;
|
||||
virtual ScFormatEntry* Clone( ScDocument& rDoc ) const = 0;
|
||||
|
||||
virtual void SetParent( ScConditionalFormat* pNew ) = 0;
|
||||
|
||||
@@ -255,7 +255,7 @@ public:
|
||||
virtual void endRendering();
|
||||
virtual void updateValues();
|
||||
protected:
|
||||
ScDocument* mpDoc;
|
||||
ScDocument& mrDoc;
|
||||
|
||||
};
|
||||
|
||||
@@ -405,7 +405,7 @@ public:
|
||||
|
||||
virtual Type GetType() const override { return eConditionType; }
|
||||
|
||||
virtual ScFormatEntry* Clone(ScDocument* pDoc) const override;
|
||||
virtual ScFormatEntry* Clone(ScDocument& rDoc) const override;
|
||||
|
||||
static ScConditionMode GetModeFromApi(css::sheet::ConditionOperator nOperator);
|
||||
|
||||
@@ -417,7 +417,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void DataChanged() const;
|
||||
ScDocument* GetDocument() const { return mpDoc; }
|
||||
ScDocument& GetDocument() const { return mrDoc; }
|
||||
ScConditionalFormat* pCondFormat;
|
||||
|
||||
private:
|
||||
@@ -481,7 +481,7 @@ public:
|
||||
|
||||
const OUString& GetStyle() const { return aStyleName; }
|
||||
void UpdateStyleName(const OUString& rNew) { aStyleName=rNew; }
|
||||
virtual ScFormatEntry* Clone(ScDocument* pDoc) const override;
|
||||
virtual ScFormatEntry* Clone(ScDocument& rDoc) const override;
|
||||
virtual Type GetType() const override { return eCondFormatType; }
|
||||
|
||||
private:
|
||||
@@ -512,8 +512,8 @@ enum ScCondFormatDateType
|
||||
class SC_DLLPUBLIC ScCondDateFormatEntry final : public ScFormatEntry
|
||||
{
|
||||
public:
|
||||
ScCondDateFormatEntry(ScDocument* pDoc);
|
||||
ScCondDateFormatEntry(ScDocument* pDoc, const ScCondDateFormatEntry& rEntry);
|
||||
ScCondDateFormatEntry(ScDocument& rDoc);
|
||||
ScCondDateFormatEntry(ScDocument& rDoc, const ScCondDateFormatEntry& rEntry);
|
||||
|
||||
bool IsValid( const ScAddress& rPos ) const;
|
||||
|
||||
@@ -529,7 +529,7 @@ public:
|
||||
virtual void UpdateDeleteTab( sc::RefUpdateDeleteTabContext& ) override {}
|
||||
virtual void UpdateMoveTab( sc::RefUpdateMoveTabContext& ) override {}
|
||||
|
||||
virtual ScFormatEntry* Clone( ScDocument* pDoc ) const override;
|
||||
virtual ScFormatEntry* Clone( ScDocument& rDoc ) const override;
|
||||
|
||||
virtual void SetParent( ScConditionalFormat* ) override {}
|
||||
|
||||
@@ -561,7 +561,7 @@ public:
|
||||
// complete conditional formatting
|
||||
class ScConditionalFormat
|
||||
{
|
||||
ScDocument* mpDoc;
|
||||
ScDocument& mrDoc;
|
||||
sal_uInt32 mnKey; // Index in attributes
|
||||
|
||||
std::vector<std::unique_ptr<ScFormatEntry>> maEntries;
|
||||
@@ -570,7 +570,7 @@ class ScConditionalFormat
|
||||
mutable std::unique_ptr<ScColorFormatCache> mpCache;
|
||||
|
||||
public:
|
||||
SC_DLLPUBLIC ScConditionalFormat(sal_uInt32 nNewKey, ScDocument* pDocument);
|
||||
SC_DLLPUBLIC ScConditionalFormat(sal_uInt32 nNewKey, ScDocument& rDocument);
|
||||
SC_DLLPUBLIC ~ScConditionalFormat();
|
||||
ScConditionalFormat(const ScConditionalFormat&) = delete;
|
||||
const ScConditionalFormat& operator=(const ScConditionalFormat&) = delete;
|
||||
@@ -588,7 +588,7 @@ public:
|
||||
bool IsEmpty() const;
|
||||
SC_DLLPUBLIC size_t size() const;
|
||||
|
||||
ScDocument* GetDocument();
|
||||
ScDocument& GetDocument();
|
||||
|
||||
void CompileAll();
|
||||
void CompileXML();
|
||||
|
||||
+1
-1
@@ -216,7 +216,7 @@ public:
|
||||
void SetModified(bool bMod) { bModified = bMod; }
|
||||
|
||||
void UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos );
|
||||
bool UpdateReference(const ScDocument* pDoc, UpdateRefMode eUpdateRefMode, SCCOL nCol1,
|
||||
bool UpdateReference(const ScDocument& rDoc, UpdateRefMode eUpdateRefMode, SCCOL nCol1,
|
||||
SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
|
||||
SCCOL nDx, SCROW nDy, SCTAB nDz);
|
||||
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ public:
|
||||
ScDetOpList(const ScDetOpList& rList);
|
||||
|
||||
void DeleteOnTab( SCTAB nTab );
|
||||
void UpdateReference( const ScDocument* pDoc, UpdateRefMode eUpdateRefMode,
|
||||
void UpdateReference( const ScDocument& rDoc, UpdateRefMode eUpdateRefMode,
|
||||
const ScRange& rRange, SCCOL nDx, SCROW nDy, SCTAB nDz );
|
||||
|
||||
bool operator==( const ScDetOpList& r ) const; // for ref-undo
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ private:
|
||||
void AddEntry_Impl(const ScCondFormatEntryItem& aEntry);
|
||||
public:
|
||||
ScTableConditionalFormat() = delete;
|
||||
ScTableConditionalFormat(const ScDocument* pDoc, sal_uLong nKey,
|
||||
ScTableConditionalFormat(const ScDocument& rDoc, sal_uLong nKey,
|
||||
SCTAB nTab, formula::FormulaGrammar::Grammar eGrammar);
|
||||
virtual ~ScTableConditionalFormat() override;
|
||||
|
||||
|
||||
+2
-2
@@ -51,7 +51,7 @@ public:
|
||||
|
||||
void Join( const ScRange&, bool bIsInList = false );
|
||||
|
||||
bool UpdateReference( UpdateRefMode, const ScDocument*,
|
||||
bool UpdateReference( UpdateRefMode, const ScDocument&,
|
||||
const ScRange& rWhere,
|
||||
SCCOL nDx,
|
||||
SCROW nDy,
|
||||
@@ -139,7 +139,7 @@ public:
|
||||
maPairs.push_back( rRangePair );
|
||||
}
|
||||
void Join( const ScRangePair&, bool bIsInList = false );
|
||||
void UpdateReference( UpdateRefMode, const ScDocument*,
|
||||
void UpdateReference( UpdateRefMode, const ScDocument&,
|
||||
const ScRange& rWhere,
|
||||
SCCOL nDx, SCROW nDy, SCTAB nDz );
|
||||
void DeleteOnTab( SCTAB nTab );
|
||||
|
||||
+3
-3
@@ -99,9 +99,9 @@ public:
|
||||
SC_DLLPUBLIC virtual ~ScValidationData() override;
|
||||
|
||||
ScValidationData* Clone() const // real copy
|
||||
{ return new ScValidationData( *GetDocument(), *this ); }
|
||||
ScValidationData* Clone(ScDocument* pNew) const override
|
||||
{ return new ScValidationData( *pNew, *this ); }
|
||||
{ return new ScValidationData( GetDocument(), *this ); }
|
||||
ScValidationData* Clone(ScDocument& rNew) const override
|
||||
{ return new ScValidationData( rNew, *this ); }
|
||||
|
||||
SC_DLLPUBLIC void ResetInput();
|
||||
SC_DLLPUBLIC void ResetError();
|
||||
|
||||
@@ -2118,7 +2118,7 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testConditionalFormatNumberInTextRule)
|
||||
ScDocument* pDocument = getScDoc();
|
||||
ScAddress aAddress(0, 0, 0);
|
||||
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(0, pDocument);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(0, *pDocument);
|
||||
ScRange aCondFormatRange(aAddress);
|
||||
ScRangeList aRangeList(aCondFormatRange);
|
||||
pFormat->SetRange(aRangeList);
|
||||
|
||||
@@ -49,18 +49,18 @@ struct ScDataBarLengthData
|
||||
double nLength;
|
||||
};
|
||||
|
||||
void testDataBarLengthImpl(ScDocument* pDoc, const ScDataBarLengthData* pData, const ScRange& rRange,
|
||||
void testDataBarLengthImpl(ScDocument& rDoc, const ScDataBarLengthData* pData, const ScRange& rRange,
|
||||
double nMinVal, ScColorScaleEntryType eMinType,
|
||||
double nMaxVal, ScColorScaleEntryType eMaxType,
|
||||
double nZeroPos, databar::ScAxisPosition eAxisPos)
|
||||
{
|
||||
std::unique_ptr<ScConditionalFormat> pFormat(new ScConditionalFormat(1, pDoc));
|
||||
std::unique_ptr<ScConditionalFormat> pFormat(new ScConditionalFormat(1, rDoc));
|
||||
ScRangeList aRangeList(rRange);
|
||||
pFormat->SetRange(aRangeList);
|
||||
|
||||
SCCOL nCol = rRange.aStart.Col();
|
||||
|
||||
ScDataBarFormat* pDatabar = new ScDataBarFormat(pDoc);
|
||||
ScDataBarFormat* pDatabar = new ScDataBarFormat(rDoc);
|
||||
pFormat->AddEntry(pDatabar);
|
||||
|
||||
ScDataBarFormatData* pFormatData = new ScDataBarFormatData();
|
||||
@@ -76,7 +76,7 @@ void testDataBarLengthImpl(ScDocument* pDoc, const ScDataBarLengthData* pData, c
|
||||
|
||||
for (size_t i = 0; pData[i].nLength != -200; ++i)
|
||||
{
|
||||
pDoc->SetValue(nCol, i, 0, pData[i].nVal);
|
||||
rDoc.SetValue(nCol, i, 0, pData[i].nVal);
|
||||
}
|
||||
|
||||
for (size_t i = 0; pData[i].nLength != -200; ++i)
|
||||
@@ -88,17 +88,17 @@ void testDataBarLengthImpl(ScDocument* pDoc, const ScDataBarLengthData* pData, c
|
||||
}
|
||||
}
|
||||
|
||||
sal_uInt32 addSingleCellCondFormat(ScDocument* pDoc, const ScAddress& rAddr, sal_uInt32 nKey, const OUString& rCondition)
|
||||
sal_uInt32 addSingleCellCondFormat(ScDocument& rDoc, const ScAddress& rAddr, sal_uInt32 nKey, const OUString& rCondition)
|
||||
{
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(nKey, pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(nKey, rDoc);
|
||||
ScRange aCondFormatRange(rAddr);
|
||||
ScRangeList aRangeList(aCondFormatRange);
|
||||
pFormat->SetRange(aRangeList);
|
||||
|
||||
ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct, rCondition, u""_ustr,
|
||||
*pDoc, ScAddress(0,0,0), ScResId(STR_STYLENAME_RESULT));
|
||||
rDoc, ScAddress(0,0,0), ScResId(STR_STYLENAME_RESULT));
|
||||
pFormat->AddEntry(pEntry);
|
||||
return pDoc->AddCondFormat(std::move(pFormat), 0);
|
||||
return rDoc.AddCondFormat(std::move(pFormat), 0);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -113,7 +113,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatINSDEL)
|
||||
m_pDoc->InsertTab(0, u"Test"_ustr);
|
||||
ScConditionalFormatList* pList = m_pDoc->GetCondFormList(0);
|
||||
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, *m_pDoc);
|
||||
ScRangeList aRangeList(ScRange(0,0,0,0,3,0));
|
||||
pFormat->SetRange(aRangeList);
|
||||
ScCondFormatEntry* pEntry = new ScCondFormatEntry(ScConditionMode::Direct,u"=B2"_ustr,u""_ustr,*m_pDoc,ScAddress(0,0,0),ScResId(STR_STYLENAME_RESULT));
|
||||
@@ -138,7 +138,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatInsertCol)
|
||||
m_pDoc->InsertTab(0, u"Test"_ustr);
|
||||
ScConditionalFormatList* pList = m_pDoc->GetCondFormList(0);
|
||||
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, *m_pDoc);
|
||||
ScRangeList aRangeList(ScRange(0,0,0,3,3,0));
|
||||
pFormat->SetRange(aRangeList);
|
||||
|
||||
@@ -161,7 +161,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatInsertRow)
|
||||
m_pDoc->InsertTab(0, u"Test"_ustr);
|
||||
ScConditionalFormatList* pList = m_pDoc->GetCondFormList(0);
|
||||
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, *m_pDoc);
|
||||
ScRangeList aRangeList(ScRange(0,0,0,3,3,0));
|
||||
pFormat->SetRange(aRangeList);
|
||||
|
||||
@@ -184,7 +184,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatInsertDeleteSheets)
|
||||
m_pDoc->InsertTab(0, u"Test"_ustr);
|
||||
|
||||
// Add a conditional format to B2:B4.
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, *m_pDoc);
|
||||
pFormat->SetRange(ScRange(1,1,0,1,3,0));
|
||||
|
||||
auto pFormatTmp = pFormat.get();
|
||||
@@ -290,12 +290,12 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testDataBarCondCopyPaste)
|
||||
{
|
||||
m_pDoc->InsertTab(0, u"Test"_ustr);
|
||||
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, *m_pDoc);
|
||||
ScRange aCondFormatRange(0, 0, 0, 2, 0, 0);
|
||||
ScRangeList aRangeList(aCondFormatRange);
|
||||
pFormat->SetRange(aRangeList);
|
||||
|
||||
ScDataBarFormat* pDatabar = new ScDataBarFormat(m_pDoc);
|
||||
ScDataBarFormat* pDatabar = new ScDataBarFormat(*m_pDoc);
|
||||
ScDataBarFormatData* pFormatData = new ScDataBarFormatData();
|
||||
pFormatData->meAxisPosition = databar::AUTOMATIC;
|
||||
pFormatData->maPositiveColor = COL_BLUE;
|
||||
@@ -398,14 +398,14 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testColorScaleInMergedCell)
|
||||
m_pDoc->SetValue(ScAddress(0, 0, 0), 1.0);
|
||||
|
||||
// Add a conditional format to A1.
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, *m_pDoc);
|
||||
pFormat->SetRange(ScRange(0, 0, 0, 0, 0, 0));
|
||||
auto pFormatTmp = pFormat.get();
|
||||
sal_uInt32 nKey = m_pDoc->AddCondFormat(std::move(pFormat), 0);
|
||||
|
||||
// Add color scale entries.
|
||||
// The coloring is based on the value. (BLUE (x <= 0), GREEN (x == 1), RED (x >= 2))
|
||||
ScColorScaleFormat* pColorScaleFormat = new ScColorScaleFormat(m_pDoc);
|
||||
ScColorScaleFormat* pColorScaleFormat = new ScColorScaleFormat(*m_pDoc);
|
||||
ScColorScaleEntry* pEntryBlue = new ScColorScaleEntry(0, COL_BLUE);
|
||||
ScColorScaleEntry* pEntryGreen = new ScColorScaleEntry(1, COL_GREEN);
|
||||
ScColorScaleEntry* pEntryRed = new ScColorScaleEntry(2, COL_RED);
|
||||
@@ -448,12 +448,12 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testColorScaleCondCopyPaste)
|
||||
{
|
||||
m_pDoc->InsertTab(0, u"Test"_ustr);
|
||||
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, *m_pDoc);
|
||||
ScRange aCondFormatRange(0, 0, 0, 2, 0, 0);
|
||||
ScRangeList aRangeList(aCondFormatRange);
|
||||
pFormat->SetRange(aRangeList);
|
||||
|
||||
ScColorScaleFormat* pColorScaleFormat = new ScColorScaleFormat(m_pDoc);
|
||||
ScColorScaleFormat* pColorScaleFormat = new ScColorScaleFormat(*m_pDoc);
|
||||
ScColorScaleEntry* pEntryBlue = new ScColorScaleEntry(0, COL_BLUE);
|
||||
ScColorScaleEntry* pEntryGreen = new ScColorScaleEntry(1, COL_GREEN);
|
||||
ScColorScaleEntry* pEntryRed = new ScColorScaleEntry(2, COL_RED);
|
||||
@@ -553,7 +553,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPaste)
|
||||
{
|
||||
m_pDoc->InsertTab(0, u"Test"_ustr);
|
||||
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, *m_pDoc);
|
||||
ScRange aCondFormatRange(0,0,0,3,3,0);
|
||||
ScRangeList aRangeList(aCondFormatRange);
|
||||
pFormat->SetRange(aRangeList);
|
||||
@@ -593,7 +593,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSingleCell)
|
||||
//e.g. fdo#82503
|
||||
m_pDoc->InsertTab(0, u"Test"_ustr);
|
||||
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, *m_pDoc);
|
||||
ScRange aCondFormatRange(0,0,0,3,3,0);
|
||||
ScRangeList aRangeList(aCondFormatRange);
|
||||
pFormat->SetRange(aRangeList);
|
||||
@@ -633,7 +633,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSingleCellToRange)
|
||||
//e.g. fdo#82503
|
||||
m_pDoc->InsertTab(0, u"Test"_ustr);
|
||||
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, *m_pDoc);
|
||||
ScRange aCondFormatRange(0,0,0,3,3,0);
|
||||
ScRangeList aRangeList(aCondFormatRange);
|
||||
pFormat->SetRange(aRangeList);
|
||||
@@ -679,7 +679,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSingleCellIntoSameFormatRa
|
||||
// e.g., tdf#95295
|
||||
m_pDoc->InsertTab(0, u"Test"_ustr);
|
||||
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, *m_pDoc);
|
||||
ScRange aCondFormatRange(0, 0, 0, 3, 3, 0);
|
||||
ScRangeList aRangeList(aCondFormatRange);
|
||||
pFormat->SetRange(aRangeList);
|
||||
@@ -717,7 +717,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSingleRowToRange)
|
||||
//e.g. tdf#106242
|
||||
m_pDoc->InsertTab(0, u"Test"_ustr);
|
||||
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, *m_pDoc);
|
||||
ScRange aCondFormatRange(0,0,0,0,0,0);
|
||||
ScRangeList aRangeList(aCondFormatRange);
|
||||
pFormat->SetRange(aRangeList);
|
||||
@@ -749,7 +749,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSingleRowToRange2)
|
||||
{
|
||||
m_pDoc->InsertTab(0, u"Test"_ustr);
|
||||
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, *m_pDoc);
|
||||
ScRange aCondFormatRange(0,0,0,0,0,0);
|
||||
ScRangeList aRangeList(aCondFormatRange);
|
||||
pFormat->SetRange(aRangeList);
|
||||
@@ -779,7 +779,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSheetBetweenDoc)
|
||||
{
|
||||
m_pDoc->InsertTab(0, u"Test"_ustr);
|
||||
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, *m_pDoc);
|
||||
ScRange aCondFormatRange(0,0,0,3,3,0);
|
||||
ScRangeList aRangeList(aCondFormatRange);
|
||||
pFormat->SetRange(aRangeList);
|
||||
@@ -801,7 +801,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSheet)
|
||||
{
|
||||
m_pDoc->InsertTab(0, u"Test"_ustr);
|
||||
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, *m_pDoc);
|
||||
ScRange aCondFormatRange(0,0,0,3,3,0);
|
||||
ScRangeList aRangeList(aCondFormatRange);
|
||||
pFormat->SetRange(aRangeList);
|
||||
@@ -835,11 +835,11 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testIconSet)
|
||||
m_pDoc->InsertTab(0, u"Test"_ustr);
|
||||
ScConditionalFormatList* pList = m_pDoc->GetCondFormList(0);
|
||||
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, *m_pDoc);
|
||||
ScRangeList aRangeList(ScRange(0,0,0,0,0,0));
|
||||
pFormat->SetRange(aRangeList);
|
||||
|
||||
ScIconSetFormat* pEntry = new ScIconSetFormat(m_pDoc);
|
||||
ScIconSetFormat* pEntry = new ScIconSetFormat(*m_pDoc);
|
||||
ScIconSetFormatData* pData = new ScIconSetFormatData;
|
||||
pData->m_Entries.emplace_back(new ScColorScaleEntry(0, COL_BLUE, COLORSCALE_VALUE, ScConditionMode::EqLess));
|
||||
pData->m_Entries.emplace_back(new ScColorScaleEntry(1, COL_GREEN, COLORSCALE_VALUE, ScConditionMode::EqGreater));
|
||||
@@ -885,7 +885,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testDataBarLengthAutomaticAxis)
|
||||
{ 0, -200 }
|
||||
};
|
||||
|
||||
testDataBarLengthImpl(m_pDoc, aValues, ScRange(0,0,0,0,7,0),
|
||||
testDataBarLengthImpl(*m_pDoc, aValues, ScRange(0,0,0,0,7,0),
|
||||
3, COLORSCALE_VALUE, 7, COLORSCALE_VALUE, 0.0, databar::AUTOMATIC);
|
||||
|
||||
static const ScDataBarLengthData aValues2[] = {
|
||||
@@ -907,7 +907,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testDataBarLengthAutomaticAxis)
|
||||
{ 9, 100.0 },
|
||||
{ 0, -200 }
|
||||
};
|
||||
testDataBarLengthImpl(m_pDoc, aValues2, ScRange(1,0,0,1,15,0),
|
||||
testDataBarLengthImpl(*m_pDoc, aValues2, ScRange(1,0,0,1,15,0),
|
||||
-4, COLORSCALE_VALUE, 8, COLORSCALE_VALUE, 1.0/3.0 * 100, databar::AUTOMATIC);
|
||||
|
||||
static const ScDataBarLengthData aValues3[] = {
|
||||
@@ -917,7 +917,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testDataBarLengthAutomaticAxis)
|
||||
{ 6, 100.0 },
|
||||
{ 0, -200 }
|
||||
};
|
||||
testDataBarLengthImpl(m_pDoc, aValues3, ScRange(2,0,0,2,3,0),
|
||||
testDataBarLengthImpl(*m_pDoc, aValues3, ScRange(2,0,0,2,3,0),
|
||||
0, COLORSCALE_MIN, 0, COLORSCALE_MAX, 0, databar::AUTOMATIC);
|
||||
|
||||
static const ScDataBarLengthData aValues4[] = {
|
||||
@@ -927,7 +927,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testDataBarLengthAutomaticAxis)
|
||||
{ 5, 100.0 },
|
||||
{ 0, -200 }
|
||||
};
|
||||
testDataBarLengthImpl(m_pDoc, aValues4, ScRange(3,0,0,3,3,0),
|
||||
testDataBarLengthImpl(*m_pDoc, aValues4, ScRange(3,0,0,3,3,0),
|
||||
0, COLORSCALE_AUTO, 0, COLORSCALE_AUTO, 0, databar::AUTOMATIC);
|
||||
|
||||
m_pDoc->DeleteTab(0);
|
||||
@@ -950,7 +950,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testDataBarLengthMiddleAxis)
|
||||
{ 0, -200 }
|
||||
};
|
||||
|
||||
testDataBarLengthImpl(m_pDoc, aValues, ScRange(0,0,0,0,8,0),
|
||||
testDataBarLengthImpl(*m_pDoc, aValues, ScRange(0,0,0,0,8,0),
|
||||
2, COLORSCALE_VALUE, 8, COLORSCALE_VALUE, 50.0, databar::MIDDLE);
|
||||
|
||||
static const ScDataBarLengthData aValues2[] = {
|
||||
@@ -972,7 +972,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testDataBarLengthMiddleAxis)
|
||||
{ 9, 100.0 },
|
||||
{ 0, -200 }
|
||||
};
|
||||
testDataBarLengthImpl(m_pDoc, aValues2, ScRange(1,0,0,1,15,0),
|
||||
testDataBarLengthImpl(*m_pDoc, aValues2, ScRange(1,0,0,1,15,0),
|
||||
-4, COLORSCALE_VALUE, 8, COLORSCALE_VALUE, 50.0, databar::MIDDLE);
|
||||
|
||||
m_pDoc->DeleteTab(0);
|
||||
@@ -1141,7 +1141,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUpdateMoveTab)
|
||||
|
||||
ScConditionEntry* pEntry = new ScConditionEntry(ScConditionMode::Equal, u"A1"_ustr, u""_ustr, *m_pDoc, ScAddress(10, 10, 0), u""_ustr, u""_ustr, formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
|
||||
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(0, m_pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(0, *m_pDoc);
|
||||
pFormat->SetRange(ScRange(10, 10, 0, 10, 12, 0));
|
||||
auto pFormatTmp = pFormat.get();
|
||||
m_pDoc->AddCondFormat(std::move(pFormat), 0);
|
||||
@@ -1177,7 +1177,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUpdateInsertTab)
|
||||
|
||||
ScConditionEntry* pEntry = new ScConditionEntry(ScConditionMode::Equal, u"A1"_ustr, u""_ustr, *m_pDoc, ScAddress(10, 10, 0), u""_ustr, u""_ustr, formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
|
||||
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(0, m_pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(0, *m_pDoc);
|
||||
pFormat->SetRange(ScRange(10, 10, 0, 10, 12, 0));
|
||||
auto pFormatTmp = pFormat.get();
|
||||
m_pDoc->AddCondFormat(std::move(pFormat), 0);
|
||||
@@ -1217,7 +1217,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUpdateDeleteTab)
|
||||
|
||||
ScConditionEntry* pEntry = new ScConditionEntry(ScConditionMode::Equal, u"A1"_ustr, u""_ustr, *m_pDoc, ScAddress(10, 10, 1), u""_ustr, u""_ustr, formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
|
||||
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(0, m_pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(0, *m_pDoc);
|
||||
pFormat->SetRange(ScRange(10, 10, 1, 10, 12, 1));
|
||||
auto pFormatTmp = pFormat.get();
|
||||
m_pDoc->AddCondFormat(std::move(pFormat), 1);
|
||||
@@ -1250,7 +1250,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUpdateReference)
|
||||
|
||||
ScConditionEntry* pEntry = new ScConditionEntry(ScConditionMode::Equal, u"A1"_ustr, u""_ustr, *m_pDoc, ScAddress(10, 10, 0), u""_ustr, u""_ustr, formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
|
||||
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(0, m_pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(0, *m_pDoc);
|
||||
pFormat->SetRange(ScRange(10, 10, 0, 10, 12, 0));
|
||||
auto pFormatTmp = pFormat.get();
|
||||
m_pDoc->AddCondFormat(std::move(pFormat), 0);
|
||||
@@ -1274,7 +1274,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUpdateReferenceDelRow)
|
||||
|
||||
ScConditionEntry* pEntry = new ScConditionEntry(ScConditionMode::Equal, u"B6"_ustr, u""_ustr, *m_pDoc, ScAddress(0, 5, 0), u""_ustr, u""_ustr, formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
|
||||
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(0, m_pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(0, *m_pDoc);
|
||||
pFormat->SetRange(ScRange(0, 5, 0, 0, 5, 0));
|
||||
auto pFormatTmp = pFormat.get();
|
||||
m_pDoc->AddCondFormat(std::move(pFormat), 0);
|
||||
@@ -1295,7 +1295,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUpdateReferenceInsRow)
|
||||
|
||||
ScConditionEntry* pEntry = new ScConditionEntry(ScConditionMode::Equal, u"B6"_ustr, u""_ustr, *m_pDoc, ScAddress(0, 5, 0), u""_ustr, u""_ustr, formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
|
||||
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(0, m_pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(0, *m_pDoc);
|
||||
pFormat->SetRange(ScRange(0, 5, 0, 0, 5, 0));
|
||||
auto pFormatTmp = pFormat.get();
|
||||
m_pDoc->AddCondFormat(std::move(pFormat), 0);
|
||||
@@ -1316,7 +1316,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUndoList)
|
||||
|
||||
ScConditionEntry* pEntry = new ScConditionEntry(ScConditionMode::Equal, u"B6"_ustr, u""_ustr, *m_pDoc, ScAddress(0, 5, 0), u""_ustr, u""_ustr, formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
|
||||
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(0, m_pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(0, *m_pDoc);
|
||||
pFormat->AddEntry(pEntry);
|
||||
pFormat->SetRange(ScRange(0, 0, 0, 0, 5, 0));
|
||||
auto pFormatTmp = pFormat.get();
|
||||
@@ -1356,8 +1356,8 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testMultipleSingleCellCondFormatCopyPaste)
|
||||
{
|
||||
m_pDoc->InsertTab(0, u"Test"_ustr);
|
||||
|
||||
sal_uInt32 nFirstCondFormatKey = addSingleCellCondFormat(m_pDoc, ScAddress(0, 0, 0), 1, u"=A2"_ustr);
|
||||
sal_uInt32 nSecondCondFormatKey = addSingleCellCondFormat(m_pDoc, ScAddress(1, 0, 0), 2, u"=B3"_ustr);
|
||||
sal_uInt32 nFirstCondFormatKey = addSingleCellCondFormat(*m_pDoc, ScAddress(0, 0, 0), 1, u"=A2"_ustr);
|
||||
sal_uInt32 nSecondCondFormatKey = addSingleCellCondFormat(*m_pDoc, ScAddress(1, 0, 0), 2, u"=B3"_ustr);
|
||||
|
||||
ScDocument aClipDoc(SCDOCMODE_CLIP);
|
||||
copyToClip(m_pDoc, ScRange(0,0,0,2,0,0), &aClipDoc);
|
||||
@@ -1388,8 +1388,8 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testDeduplicateMultipleCondFormats)
|
||||
{
|
||||
m_pDoc->InsertTab(0, u"Test"_ustr);
|
||||
|
||||
sal_uInt32 nFirstCondFormatKey = addSingleCellCondFormat(m_pDoc, ScAddress(0, 0, 0), 1, u"=B2"_ustr);
|
||||
sal_uInt32 nSecondCondFormatKey = addSingleCellCondFormat(m_pDoc, ScAddress(1, 0, 0), 2, u"=B2"_ustr);
|
||||
sal_uInt32 nFirstCondFormatKey = addSingleCellCondFormat(*m_pDoc, ScAddress(0, 0, 0), 1, u"=B2"_ustr);
|
||||
sal_uInt32 nSecondCondFormatKey = addSingleCellCondFormat(*m_pDoc, ScAddress(1, 0, 0), 2, u"=B2"_ustr);
|
||||
|
||||
ScDocument aClipDoc(SCDOCMODE_CLIP);
|
||||
copyToClip(m_pDoc, ScRange(0,0,0,2,0,0), &aClipDoc);
|
||||
@@ -1422,11 +1422,11 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatListenToOwnRange)
|
||||
|
||||
ScConditionalFormatList* pList = m_pDoc->GetCondFormList(0);
|
||||
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, *m_pDoc);
|
||||
ScRangeList aRangeList(ScRange(0,0,0,10,0,0));
|
||||
pFormat->SetRange(aRangeList);
|
||||
|
||||
ScIconSetFormat* pEntry = new ScIconSetFormat(m_pDoc);
|
||||
ScIconSetFormat* pEntry = new ScIconSetFormat(*m_pDoc);
|
||||
ScIconSetFormatData* pData = new ScIconSetFormatData;
|
||||
pData->m_Entries.emplace_back(new ScColorScaleEntry(0, COL_BLUE));
|
||||
pData->m_Entries.emplace_back(new ScColorScaleEntry(1, COL_GREEN));
|
||||
@@ -1458,7 +1458,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatVolatileFunctionRecalc)
|
||||
|
||||
ScConditionalFormatList* pList = m_pDoc->GetCondFormList(0);
|
||||
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, *m_pDoc);
|
||||
ScRangeList aRangeList(ScRange(0,0,0,10,0,0));
|
||||
pFormat->SetRange(aRangeList);
|
||||
|
||||
@@ -1502,7 +1502,7 @@ CPPUNIT_TEST_FIXTURE(TestCondformat, testConditionStyleInMergedCell)
|
||||
m_pDoc->SetValue(ScAddress(0, 0, 0), 1.0);
|
||||
|
||||
// Add a conditional format.
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(1, *m_pDoc);
|
||||
pFormat->SetRange(ScRange(0, 0, 0, 0, 0, 0));
|
||||
|
||||
// Add condition in which if the value equals 1, set the "Good" style.
|
||||
|
||||
@@ -410,7 +410,7 @@ CPPUNIT_TEST_FIXTURE(Test, testJoin_Case5)
|
||||
CPPUNIT_TEST_FIXTURE(Test, testUpdateReference_DeleteRow)
|
||||
{
|
||||
ScRangeList aList(ScRange(1,1,0,4,4,0));
|
||||
bool bUpdated = aList.UpdateReference(URM_INSDEL, m_pDoc, ScRange(0,3,0,m_pDoc->MaxCol(),m_pDoc->MaxRow(),0), 0, -1, 0);
|
||||
bool bUpdated = aList.UpdateReference(URM_INSDEL, *m_pDoc, ScRange(0,3,0,m_pDoc->MaxCol(),m_pDoc->MaxRow(),0), 0, -1, 0);
|
||||
CPPUNIT_ASSERT(bUpdated);
|
||||
|
||||
for(SCCOL nCol = 1; nCol <= 4; ++nCol)
|
||||
@@ -424,13 +424,13 @@ CPPUNIT_TEST_FIXTURE(Test, testUpdateReference_DeleteRow)
|
||||
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt64>(12), aList.GetCellCount());
|
||||
|
||||
ScRangeList aList2(ScRange(2,2,0,2,2,0));
|
||||
aList2.UpdateReference(URM_INSDEL, m_pDoc, ScRange(0,3,0,m_pDoc->MaxCol(),m_pDoc->MaxRow(),0), 0, -1, 0);
|
||||
aList2.UpdateReference(URM_INSDEL, *m_pDoc, ScRange(0,3,0,m_pDoc->MaxCol(),m_pDoc->MaxRow(),0), 0, -1, 0);
|
||||
CPPUNIT_ASSERT(aList2.empty());
|
||||
|
||||
ScRangeList aList3;
|
||||
aList3.push_back(ScRange(2,2,0,2,8,0));
|
||||
aList3.push_back(ScRange(4,2,0,4,8,0));
|
||||
aList3.UpdateReference(URM_INSDEL, m_pDoc, ScRange(2,5,0,m_pDoc->MaxCol(),m_pDoc->MaxRow(),0), 0, -1, 0);
|
||||
aList3.UpdateReference(URM_INSDEL, *m_pDoc, ScRange(2,5,0,m_pDoc->MaxCol(),m_pDoc->MaxRow(),0), 0, -1, 0);
|
||||
// Verify all ranges in the list have been updated properly.
|
||||
CPPUNIT_ASSERT_EQUAL(size_t(2), aList3.size());
|
||||
CPPUNIT_ASSERT_EQUAL(ScRange(2,2,0,2,7,0), aList3[0]);
|
||||
@@ -438,21 +438,21 @@ CPPUNIT_TEST_FIXTURE(Test, testUpdateReference_DeleteRow)
|
||||
|
||||
ScRangeList aList4(ScRange(0,0,0,m_pDoc->MaxCol(),m_pDoc->MaxRow(),0));
|
||||
ScRangeList aList4Copy = aList4;
|
||||
aList4.UpdateReference(URM_INSDEL, m_pDoc, ScRange(14,3,0,m_pDoc->MaxCol(),7,0), 0, -2, 0);
|
||||
aList4.UpdateReference(URM_INSDEL, *m_pDoc, ScRange(14,3,0,m_pDoc->MaxCol(),7,0), 0, -2, 0);
|
||||
CPPUNIT_ASSERT_EQUAL(aList4Copy, aList4);
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(Test, testUpdateReference_DeleteLastRow)
|
||||
{
|
||||
ScRangeList aList(ScRange(1,1,0,4,4,0));
|
||||
bool bUpdated = aList.UpdateReference(URM_INSDEL, m_pDoc, ScRange(0,4,0,m_pDoc->MaxCol(),4,0), 0, -1, 0);
|
||||
bool bUpdated = aList.UpdateReference(URM_INSDEL, *m_pDoc, ScRange(0,4,0,m_pDoc->MaxCol(),4,0), 0, -1, 0);
|
||||
CPPUNIT_ASSERT(bUpdated);
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(Test, testUpdateReference_DeleteCol)
|
||||
{
|
||||
ScRangeList aList(ScRange(1,1,0,4,4,0));
|
||||
bool bUpdated = aList.UpdateReference(URM_INSDEL, m_pDoc, ScRange(3,0,0,m_pDoc->MaxCol(),m_pDoc->MaxRow(),0), -1, 0, 0);
|
||||
bool bUpdated = aList.UpdateReference(URM_INSDEL, *m_pDoc, ScRange(3,0,0,m_pDoc->MaxCol(),m_pDoc->MaxRow(),0), -1, 0, 0);
|
||||
CPPUNIT_ASSERT(bUpdated);
|
||||
|
||||
for(SCROW nRow = 1; nRow <= 4; ++nRow)
|
||||
|
||||
@@ -40,10 +40,10 @@ ScBroadcastArea::ScBroadcastArea( const ScRange& rRange ) :
|
||||
mbInUpdateChain(false),
|
||||
mbGroupListening(false) {}
|
||||
|
||||
ScBroadcastAreaSlot::ScBroadcastAreaSlot( ScDocument* pDocument,
|
||||
ScBroadcastAreaSlot::ScBroadcastAreaSlot( ScDocument& rDocument,
|
||||
ScBroadcastAreaSlotMachine* pBASMa ) :
|
||||
aTmpSeekBroadcastArea( ScRange()),
|
||||
pDoc( pDocument ),
|
||||
rDoc( rDocument ),
|
||||
pBASM( pBASMa ),
|
||||
mbInBroadcastIteration( false),
|
||||
mbHasErasedArea(false)
|
||||
@@ -68,20 +68,20 @@ ScBroadcastAreaSlot::~ScBroadcastAreaSlot()
|
||||
|
||||
ScDocument::HardRecalcState ScBroadcastAreaSlot::CheckHardRecalcStateCondition() const
|
||||
{
|
||||
ScDocument::HardRecalcState eState = pDoc->GetHardRecalcState();
|
||||
ScDocument::HardRecalcState eState = rDoc.GetHardRecalcState();
|
||||
if (eState == ScDocument::HardRecalcState::OFF)
|
||||
{
|
||||
if (aBroadcastAreaTbl.size() >= aBroadcastAreaTbl.max_size())
|
||||
{ // this is more hypothetical now, check existed for old SV_PTRARR_SORT
|
||||
ScDocShell* pShell = pDoc->GetDocumentShell();
|
||||
ScDocShell* pShell = rDoc.GetDocumentShell();
|
||||
OSL_ENSURE( pShell, "Missing DocShell :-/" );
|
||||
|
||||
if ( pShell )
|
||||
pShell->SetError(SCWARN_CORE_HARD_RECALC);
|
||||
|
||||
pDoc->SetAutoCalc( false );
|
||||
rDoc.SetAutoCalc( false );
|
||||
eState = ScDocument::HardRecalcState::ETERNAL;
|
||||
pDoc->SetHardRecalcState( eState );
|
||||
rDoc.SetHardRecalcState( eState );
|
||||
}
|
||||
}
|
||||
return eState;
|
||||
@@ -92,7 +92,7 @@ bool ScBroadcastAreaSlot::StartListeningArea(
|
||||
{
|
||||
bool bNewArea = false;
|
||||
OSL_ENSURE(pListener, "StartListeningArea: pListener Null");
|
||||
assert(!pDoc->IsDelayedFormulaGrouping()); // otherwise the group size might be incorrect
|
||||
assert(!rDoc.IsDelayedFormulaGrouping()); // otherwise the group size might be incorrect
|
||||
if (CheckHardRecalcStateCondition() == ScDocument::HardRecalcState::ETERNAL)
|
||||
return false;
|
||||
if ( !rpArea )
|
||||
@@ -357,7 +357,7 @@ void ScBroadcastAreaSlot::UpdateRemove( UpdateRefMode eUpdateRefMode,
|
||||
else
|
||||
{
|
||||
pArea->GetRange().GetVars( theCol1, theRow1, theTab1, theCol2, theRow2, theTab2);
|
||||
if ( ScRefUpdate::Update( pDoc, eUpdateRefMode,
|
||||
if ( ScRefUpdate::Update( rDoc, eUpdateRefMode,
|
||||
nCol1,nRow1,nTab1, nCol2,nRow2,nTab2, nDx,nDy,nDz,
|
||||
theCol1,theRow1,theTab1, theCol2,theRow2,theTab2 ))
|
||||
{
|
||||
@@ -553,8 +553,8 @@ ScBroadcastAreaSlotMachine::TableSlots::~TableSlots()
|
||||
}
|
||||
|
||||
ScBroadcastAreaSlotMachine::ScBroadcastAreaSlotMachine(
|
||||
ScDocument* pDocument ) :
|
||||
pDoc( pDocument ),
|
||||
ScDocument& rDocument ) :
|
||||
rDoc( rDocument ),
|
||||
pUpdateChain( nullptr ),
|
||||
pEOUpdateChain( nullptr ),
|
||||
nInBulkBroadcast( 0 )
|
||||
@@ -575,7 +575,7 @@ ScBroadcastAreaSlotMachine::ScBroadcastAreaSlotMachine(
|
||||
sal_Int32 nCol1 = 0;
|
||||
sal_Int32 nCol2 = 1024;
|
||||
SCSIZE nSliceCol = 16;
|
||||
while (nCol2 <= pDoc->GetMaxColCount())
|
||||
while (nCol2 <= rDoc.GetMaxColCount())
|
||||
{
|
||||
SCROW nRow1 = 0;
|
||||
SCROW nRow2 = 32*1024;
|
||||
@@ -583,7 +583,7 @@ ScBroadcastAreaSlotMachine::ScBroadcastAreaSlotMachine(
|
||||
SCSIZE nSlotsCol = 0;
|
||||
SCSIZE nSlotsStartCol = nSlots;
|
||||
// Must be sorted by row1,row2!
|
||||
while (nRow2 <= pDoc->GetMaxRowCount())
|
||||
while (nRow2 <= rDoc.GetMaxRowCount())
|
||||
{
|
||||
maSlotDistribution.emplace_back(nRow1, nRow2, nSliceRow, nSlotsCol, nCol1, nCol2, nSliceCol, nSlotsStartCol);
|
||||
nSlotsCol += (nRow2 - nRow1) / nSliceRow;
|
||||
@@ -621,7 +621,7 @@ inline SCSIZE ScBroadcastAreaSlotMachine::ComputeSlotOffset(
|
||||
{
|
||||
SCROW nRow = rAddress.Row();
|
||||
SCCOL nCol = rAddress.Col();
|
||||
if ( !pDoc->ValidRow(nRow) || !pDoc->ValidCol(nCol) )
|
||||
if ( !rDoc.ValidRow(nRow) || !rDoc.ValidCol(nCol) )
|
||||
{
|
||||
OSL_FAIL( "Row/Col invalid, using first slot!" );
|
||||
return 0;
|
||||
@@ -693,7 +693,7 @@ void ScBroadcastAreaSlotMachine::DoChecks()
|
||||
compare( ComputeSlotOffset( ScAddress( nSliceCol - 1, 0, 0 )),
|
||||
ComputeSlotOffset( ScAddress( nSliceCol, 0, 0 )) - mnBcaSlotsCol, __LINE__ );
|
||||
// Check that last cell is the last slot.
|
||||
compare( ComputeSlotOffset( ScAddress( pDoc->GetMaxColCount() - 1, pDoc->GetMaxRowCount() - 1, 0 )),
|
||||
compare( ComputeSlotOffset( ScAddress( rDoc.GetMaxColCount() - 1, rDoc.GetMaxRowCount() - 1, 0 )),
|
||||
mnBcaSlots - 1, __LINE__ );
|
||||
// Check that adjacent rows in the same column but in different distribution areas differ by one slot.
|
||||
for( size_t i = 0; i < maSlotDistribution.size() - 1; ++i )
|
||||
@@ -723,7 +723,7 @@ void ScBroadcastAreaSlotMachine::DoChecks()
|
||||
}
|
||||
}
|
||||
// Iterate all slots.
|
||||
ScRange range( ScAddress( 0, 0, 0 ), ScAddress( pDoc->MaxCol(), pDoc->MaxRow(), 0 ));
|
||||
ScRange range( ScAddress( 0, 0, 0 ), ScAddress( rDoc.MaxCol(), rDoc.MaxRow(), 0 ));
|
||||
SCSIZE nStart, nEnd, nRowBreak;
|
||||
ComputeAreaPoints( range, nStart, nEnd, nRowBreak );
|
||||
assert( nStart == 0 );
|
||||
@@ -740,8 +740,8 @@ void ScBroadcastAreaSlotMachine::DoChecks()
|
||||
compare( nOff, previous + 1, __LINE__ );
|
||||
}
|
||||
// Iterate slots in the last row (each will differ by mnBcaSlotsCol).
|
||||
range = ScRange( ScAddress( 0, pDoc->MaxRow(), 0 ),
|
||||
ScAddress( pDoc->MaxCol(), pDoc->MaxRow() - 1, 0 ));
|
||||
range = ScRange( ScAddress( 0, rDoc.MaxRow(), 0 ),
|
||||
ScAddress( rDoc.MaxCol(), rDoc.MaxRow() - 1, 0 ));
|
||||
ComputeAreaPoints( range, nStart, nEnd, nRowBreak );
|
||||
assert( nStart == mnBcaSlotsCol - 1 );
|
||||
assert( nEnd == mnBcaSlots - 1 );
|
||||
@@ -791,7 +791,7 @@ void ScBroadcastAreaSlotMachine::StartListeningArea(
|
||||
while ( !bDone && nOff <= nEnd )
|
||||
{
|
||||
if ( !*pp )
|
||||
*pp = new ScBroadcastAreaSlot( pDoc, this );
|
||||
*pp = new ScBroadcastAreaSlot( rDoc, this );
|
||||
if (!pArea)
|
||||
{
|
||||
// If the call to StartListeningArea didn't create the
|
||||
@@ -1088,7 +1088,7 @@ void ScBroadcastAreaSlotMachine::UpdateBroadcastAreas(
|
||||
|
||||
// update range
|
||||
aRange.GetVars( theCol1, theRow1, theTab1, theCol2, theRow2, theTab2);
|
||||
if ( ScRefUpdate::Update( pDoc, eUpdateRefMode,
|
||||
if ( ScRefUpdate::Update( rDoc, eUpdateRefMode,
|
||||
nCol1,nRow1,nTab1, nCol2,nRow2,nTab2, nDx,nDy,nDz,
|
||||
theCol1,theRow1,theTab1, theCol2,theRow2,theTab2 ))
|
||||
{
|
||||
@@ -1114,7 +1114,7 @@ void ScBroadcastAreaSlotMachine::UpdateBroadcastAreas(
|
||||
while ( nOff <= nEnd )
|
||||
{
|
||||
if (!*pp)
|
||||
*pp = new ScBroadcastAreaSlot( pDoc, this );
|
||||
*pp = new ScBroadcastAreaSlot( rDoc, this );
|
||||
(*pp)->UpdateInsert( pArea );
|
||||
ComputeNextSlot( nOff, nBreak, pp, nStart, ppSlots, nRowBreak, mnBcaSlotsCol);
|
||||
}
|
||||
@@ -1147,10 +1147,10 @@ void ScBroadcastAreaSlotMachine::LeaveBulkBroadcast( SfxHintId nHintId )
|
||||
ScBroadcastAreasBulk().swap( aBulkBroadcastAreas);
|
||||
bool bBroadcasted = BulkBroadcastGroupAreas();
|
||||
// Trigger the "final" tracking.
|
||||
if (pDoc->IsTrackFormulasPending())
|
||||
pDoc->FinalTrackFormulas( nHintId );
|
||||
if (rDoc.IsTrackFormulasPending())
|
||||
rDoc.FinalTrackFormulas( nHintId );
|
||||
else if (bBroadcasted)
|
||||
pDoc->TrackFormulas( nHintId );
|
||||
rDoc.TrackFormulas( nHintId );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1169,7 +1169,7 @@ void ScBroadcastAreaSlotMachine::InsertBulkGroupArea( ScBroadcastArea* pArea, co
|
||||
}
|
||||
|
||||
sc::ColumnSpanSet& rSet = it->second;
|
||||
rSet.set(*pDoc, rRange, true);
|
||||
rSet.set(rDoc, rRange, true);
|
||||
}
|
||||
|
||||
bool ScBroadcastAreaSlotMachine::BulkBroadcastGroupAreas()
|
||||
@@ -1177,7 +1177,7 @@ bool ScBroadcastAreaSlotMachine::BulkBroadcastGroupAreas()
|
||||
if (m_BulkGroupAreas.empty())
|
||||
return false;
|
||||
|
||||
sc::BulkDataHint aHint( *pDoc );
|
||||
sc::BulkDataHint aHint( rDoc );
|
||||
|
||||
bool bBroadcasted = false;
|
||||
for (const auto& [pArea, rSpans] : m_BulkGroupAreas)
|
||||
|
||||
@@ -185,7 +185,7 @@ ScColorScaleEntry::ScColorScaleEntry(const ScColorScaleEntry& rEntry):
|
||||
}
|
||||
}
|
||||
|
||||
ScColorScaleEntry::ScColorScaleEntry(ScDocument* pDoc, const ScColorScaleEntry& rEntry):
|
||||
ScColorScaleEntry::ScColorScaleEntry(ScDocument& rDoc, const ScColorScaleEntry& rEntry):
|
||||
mnVal(rEntry.mnVal),
|
||||
mpFormat(rEntry.mpFormat),
|
||||
maColor(rEntry.maColor),
|
||||
@@ -195,8 +195,8 @@ ScColorScaleEntry::ScColorScaleEntry(ScDocument* pDoc, const ScColorScaleEntry&
|
||||
setListener();
|
||||
if(rEntry.mpCell)
|
||||
{
|
||||
mpCell.reset(new ScFormulaCell(*rEntry.mpCell, *pDoc, rEntry.mpCell->aPos, ScCloneFlags::NoMakeAbsExternal));
|
||||
mpCell->StartListeningTo( *pDoc );
|
||||
mpCell.reset(new ScFormulaCell(*rEntry.mpCell, rDoc, rEntry.mpCell->aPos, ScCloneFlags::NoMakeAbsExternal));
|
||||
mpCell->StartListeningTo( rDoc );
|
||||
mpListener.reset(new ScFormulaListener(mpCell.get()));
|
||||
if (mpFormat)
|
||||
mpListener->setCallback([&]() { mpFormat->DoRepaint();});
|
||||
@@ -356,7 +356,7 @@ void ScColorScaleEntry::setListener()
|
||||
|| meType == COLORSCALE_MIN || meType == COLORSCALE_MAX
|
||||
|| meType == COLORSCALE_AUTO)
|
||||
{
|
||||
mpListener.reset(new ScFormulaListener(*mpFormat->GetDocument(), mpFormat->GetRange()));
|
||||
mpListener.reset(new ScFormulaListener(mpFormat->GetDocument(), mpFormat->GetRange()));
|
||||
mpListener->setCallback([&]() { mpFormat->DoRepaint();});
|
||||
}
|
||||
}
|
||||
@@ -366,8 +366,8 @@ void ScColorScaleEntry::SetRepaintCallback(const std::function<void()>& func)
|
||||
mpListener->setCallback(func);
|
||||
}
|
||||
|
||||
ScColorFormat::ScColorFormat(ScDocument* pDoc)
|
||||
: ScFormatEntry(pDoc)
|
||||
ScColorFormat::ScColorFormat(ScDocument& rDoc)
|
||||
: ScFormatEntry(rDoc)
|
||||
, mpParent(nullptr)
|
||||
{
|
||||
}
|
||||
@@ -381,26 +381,26 @@ void ScColorFormat::SetParent( ScConditionalFormat* pParent )
|
||||
mpParent = pParent;
|
||||
}
|
||||
|
||||
ScColorScaleFormat::ScColorScaleFormat(ScDocument* pDoc):
|
||||
ScColorFormat(pDoc)
|
||||
ScColorScaleFormat::ScColorScaleFormat(ScDocument& rDoc):
|
||||
ScColorFormat(rDoc)
|
||||
{
|
||||
}
|
||||
|
||||
ScColorScaleFormat::ScColorScaleFormat(ScDocument* pDoc, const ScColorScaleFormat& rFormat):
|
||||
ScColorFormat(pDoc)
|
||||
ScColorScaleFormat::ScColorScaleFormat(ScDocument& rDoc, const ScColorScaleFormat& rFormat):
|
||||
ScColorFormat(rDoc)
|
||||
{
|
||||
for(const auto& rxEntry : rFormat)
|
||||
{
|
||||
maColorScales.emplace_back(new ScColorScaleEntry(pDoc, *rxEntry));
|
||||
maColorScales.emplace_back(new ScColorScaleEntry(rDoc, *rxEntry));
|
||||
}
|
||||
|
||||
auto aCache = rFormat.GetCache();
|
||||
SetCache(aCache);
|
||||
}
|
||||
|
||||
ScColorFormat* ScColorScaleFormat::Clone(ScDocument* pDoc) const
|
||||
ScColorFormat* ScColorScaleFormat::Clone(ScDocument& rDoc) const
|
||||
{
|
||||
return new ScColorScaleFormat(pDoc, *this);
|
||||
return new ScColorScaleFormat(rDoc, *this);
|
||||
}
|
||||
|
||||
ScColorScaleFormat::~ScColorScaleFormat()
|
||||
@@ -523,10 +523,10 @@ std::vector<double>& ScColorFormat::getValues() const
|
||||
SCCOL nColEnd = rRange.aEnd.Col();
|
||||
SCROW nRowEnd = rRange.aEnd.Row();
|
||||
|
||||
if(nRowEnd == mpDoc->MaxRow())
|
||||
if(nRowEnd == mrDoc.MaxRow())
|
||||
{
|
||||
bool bShrunk = false;
|
||||
mpDoc->ShrinkToUsedDataArea(bShrunk, nTab, nColStart, nRowStart,
|
||||
mrDoc.ShrinkToUsedDataArea(bShrunk, nTab, nColStart, nRowStart,
|
||||
nColEnd, nRowEnd, false);
|
||||
}
|
||||
for(SCCOL nCol = nColStart; nCol <= nColEnd; ++nCol)
|
||||
@@ -534,7 +534,7 @@ std::vector<double>& ScColorFormat::getValues() const
|
||||
for(SCROW nRow = nRowStart; nRow <= nRowEnd; ++nRow)
|
||||
{
|
||||
ScAddress aAddr(nCol, nRow, nTab);
|
||||
ScRefCellValue rCell(*mpDoc, aAddr);
|
||||
ScRefCellValue rCell(mrDoc, aAddr);
|
||||
if(rCell.hasNumeric())
|
||||
{
|
||||
double aVal = rCell.getValue();
|
||||
@@ -662,7 +662,7 @@ double ScColorScaleFormat::CalcValue(double nMin, double nMax, const ScColorScal
|
||||
|
||||
std::optional<Color> ScColorScaleFormat::GetColor( const ScAddress& rAddr ) const
|
||||
{
|
||||
ScRefCellValue rCell(*mpDoc, rAddr);
|
||||
ScRefCellValue rCell(mrDoc, rAddr);
|
||||
if(!rCell.hasNumeric())
|
||||
return std::optional<Color>();
|
||||
|
||||
@@ -784,14 +784,14 @@ void ScColorScaleFormat::EnsureSize()
|
||||
}
|
||||
}
|
||||
|
||||
ScDataBarFormat::ScDataBarFormat(ScDocument* pDoc):
|
||||
ScColorFormat(pDoc),
|
||||
ScDataBarFormat::ScDataBarFormat(ScDocument& rDoc):
|
||||
ScColorFormat(rDoc),
|
||||
mpFormatData(new ScDataBarFormatData())
|
||||
{
|
||||
}
|
||||
|
||||
ScDataBarFormat::ScDataBarFormat(ScDocument* pDoc, const ScDataBarFormat& rFormat):
|
||||
ScColorFormat(pDoc),
|
||||
ScDataBarFormat::ScDataBarFormat(ScDocument& rDoc, const ScDataBarFormat& rFormat):
|
||||
ScColorFormat(rDoc),
|
||||
mpFormatData(new ScDataBarFormatData(*rFormat.mpFormatData))
|
||||
{
|
||||
}
|
||||
@@ -816,9 +816,9 @@ const ScDataBarFormatData* ScDataBarFormat::GetDataBarData() const
|
||||
return mpFormatData.get();
|
||||
}
|
||||
|
||||
ScColorFormat* ScDataBarFormat::Clone(ScDocument* pDoc) const
|
||||
ScColorFormat* ScDataBarFormat::Clone(ScDocument& rDoc) const
|
||||
{
|
||||
return new ScDataBarFormat(pDoc, *this);
|
||||
return new ScDataBarFormat(rDoc, *this);
|
||||
}
|
||||
|
||||
void ScDataBarFormat::SetParent(ScConditionalFormat* pFormat)
|
||||
@@ -948,7 +948,7 @@ double ScDataBarFormat::getMax(double nMin, double nMax) const
|
||||
|
||||
std::unique_ptr<ScDataBarInfo> ScDataBarFormat::GetDataBarInfo(const ScAddress& rAddr) const
|
||||
{
|
||||
ScRefCellValue rCell(*mpDoc, rAddr);
|
||||
ScRefCellValue rCell(mrDoc, rAddr);
|
||||
if(!rCell.hasNumeric())
|
||||
return nullptr;
|
||||
|
||||
@@ -1117,21 +1117,21 @@ ScIconSetFormatData::ScIconSetFormatData(ScIconSetFormatData const& rOther)
|
||||
}
|
||||
}
|
||||
|
||||
ScIconSetFormat::ScIconSetFormat(ScDocument* pDoc):
|
||||
ScColorFormat(pDoc),
|
||||
ScIconSetFormat::ScIconSetFormat(ScDocument& rDoc):
|
||||
ScColorFormat(rDoc),
|
||||
mpFormatData(new ScIconSetFormatData)
|
||||
{
|
||||
}
|
||||
|
||||
ScIconSetFormat::ScIconSetFormat(ScDocument* pDoc, const ScIconSetFormat& rFormat):
|
||||
ScColorFormat(pDoc),
|
||||
ScIconSetFormat::ScIconSetFormat(ScDocument& rDoc, const ScIconSetFormat& rFormat):
|
||||
ScColorFormat(rDoc),
|
||||
mpFormatData(new ScIconSetFormatData(*rFormat.mpFormatData))
|
||||
{
|
||||
}
|
||||
|
||||
ScColorFormat* ScIconSetFormat::Clone( ScDocument* pDoc ) const
|
||||
ScColorFormat* ScIconSetFormat::Clone( ScDocument& rDoc ) const
|
||||
{
|
||||
return new ScIconSetFormat(pDoc, *this);
|
||||
return new ScIconSetFormat(rDoc, *this);
|
||||
}
|
||||
|
||||
void ScIconSetFormat::SetParent(ScConditionalFormat* pFormat)
|
||||
@@ -1161,7 +1161,7 @@ const ScIconSetFormatData* ScIconSetFormat::GetIconSetData() const
|
||||
|
||||
std::unique_ptr<ScIconSetInfo> ScIconSetFormat::GetIconSetInfo(const ScAddress& rAddr) const
|
||||
{
|
||||
ScRefCellValue rCell(*mpDoc, rAddr);
|
||||
ScRefCellValue rCell(mrDoc, rAddr);
|
||||
if(!rCell.hasNumeric())
|
||||
return nullptr;
|
||||
|
||||
@@ -1195,7 +1195,7 @@ std::unique_ptr<ScIconSetInfo> ScIconSetFormat::GetIconSetInfo(const ScAddress&
|
||||
|
||||
std::unique_ptr<ScIconSetInfo> pInfo(new ScIconSetInfo);
|
||||
|
||||
const SfxPoolItem& rPoolItem = mpDoc->GetPattern(rAddr)->GetItem(ATTR_FONT_HEIGHT);
|
||||
const SfxPoolItem& rPoolItem = mrDoc.GetPattern(rAddr)->GetItem(ATTR_FONT_HEIGHT);
|
||||
tools::Long aFontHeight = static_cast<const SvxFontHeightItem&>(rPoolItem).GetHeight();
|
||||
pInfo->mnHeight = aFontHeight;
|
||||
|
||||
|
||||
@@ -48,8 +48,8 @@
|
||||
|
||||
using namespace formula;
|
||||
|
||||
ScFormatEntry::ScFormatEntry(ScDocument* pDoc):
|
||||
mpDoc(pDoc)
|
||||
ScFormatEntry::ScFormatEntry(ScDocument& rDoc):
|
||||
mrDoc(rDoc)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ void ScFormatEntry::updateValues()
|
||||
{
|
||||
}
|
||||
|
||||
static bool lcl_HasRelRef( ScDocument* pDoc, const ScTokenArray* pFormula, sal_uInt16 nRecursion = 0 )
|
||||
static bool lcl_HasRelRef( ScDocument& rDoc, const ScTokenArray* pFormula, sal_uInt16 nRecursion = 0 )
|
||||
{
|
||||
if (pFormula)
|
||||
{
|
||||
@@ -107,8 +107,8 @@ static bool lcl_HasRelRef( ScDocument* pDoc, const ScTokenArray* pFormula, sal_u
|
||||
case svIndex:
|
||||
{
|
||||
if( t->GetOpCode() == ocName ) // DB areas always absolute
|
||||
if( ScRangeData* pRangeData = pDoc->FindRangeNameBySheetAndIndex( t->GetSheet(), t->GetIndex()) )
|
||||
if( (nRecursion < 42) && lcl_HasRelRef( pDoc, pRangeData->GetCode(), nRecursion + 1 ) )
|
||||
if( ScRangeData* pRangeData = rDoc.FindRangeNameBySheetAndIndex( t->GetSheet(), t->GetIndex()) )
|
||||
if( (nRecursion < 42) && lcl_HasRelRef( rDoc, pRangeData->GetCode(), nRecursion + 1 ) )
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
@@ -176,7 +176,7 @@ void ScConditionEntry::SetParent(ScConditionalFormat* pParent)
|
||||
}
|
||||
|
||||
ScConditionEntry::ScConditionEntry( const ScConditionEntry& r ) :
|
||||
ScFormatEntry(r.mpDoc),
|
||||
ScFormatEntry(r.mrDoc),
|
||||
eOp(r.eOp),
|
||||
nOptions(r.nOptions),
|
||||
nVal1(r.nVal1),
|
||||
@@ -194,7 +194,7 @@ ScConditionEntry::ScConditionEntry( const ScConditionEntry& r ) :
|
||||
bRelRef1(r.bRelRef1),
|
||||
bRelRef2(r.bRelRef2),
|
||||
bFirstRun(true),
|
||||
mpListener(new ScFormulaListener(*r.mpDoc)),
|
||||
mpListener(new ScFormulaListener(r.mrDoc)),
|
||||
eConditionType( r.eConditionType ),
|
||||
pCondFormat(r.pCondFormat),
|
||||
mpRepaintTask()
|
||||
@@ -210,7 +210,7 @@ ScConditionEntry::ScConditionEntry( const ScConditionEntry& r ) :
|
||||
}
|
||||
|
||||
ScConditionEntry::ScConditionEntry( ScDocument& rDocument, const ScConditionEntry& r ) :
|
||||
ScFormatEntry(&rDocument),
|
||||
ScFormatEntry(rDocument),
|
||||
eOp(r.eOp),
|
||||
nOptions(r.nOptions),
|
||||
nVal1(r.nVal1),
|
||||
@@ -248,7 +248,7 @@ ScConditionEntry::ScConditionEntry( ScConditionMode eOper,
|
||||
const OUString& rExprNmsp1, const OUString& rExprNmsp2,
|
||||
FormulaGrammar::Grammar eGrammar1, FormulaGrammar::Grammar eGrammar2,
|
||||
Type eType ) :
|
||||
ScFormatEntry(&rDocument),
|
||||
ScFormatEntry(rDocument),
|
||||
eOp(eOper),
|
||||
nOptions(0),
|
||||
nVal1(0.0),
|
||||
@@ -276,7 +276,7 @@ ScConditionEntry::ScConditionEntry( ScConditionMode eOper,
|
||||
ScConditionEntry::ScConditionEntry( ScConditionMode eOper,
|
||||
const ScTokenArray* pArr1, const ScTokenArray* pArr2,
|
||||
ScDocument& rDocument, const ScAddress& rPos ) :
|
||||
ScFormatEntry(&rDocument),
|
||||
ScFormatEntry(rDocument),
|
||||
eOp(eOper),
|
||||
nOptions(0),
|
||||
nVal1(0.0),
|
||||
@@ -298,13 +298,13 @@ ScConditionEntry::ScConditionEntry( ScConditionMode eOper,
|
||||
{
|
||||
pFormula1.reset( new ScTokenArray( *pArr1 ) );
|
||||
SimplifyCompiledFormula( pFormula1, nVal1, bIsStr1, aStrVal1 );
|
||||
bRelRef1 = lcl_HasRelRef( mpDoc, pFormula1.get() );
|
||||
bRelRef1 = lcl_HasRelRef( mrDoc, pFormula1.get() );
|
||||
}
|
||||
if ( pArr2 )
|
||||
{
|
||||
pFormula2.reset( new ScTokenArray( *pArr2 ) );
|
||||
SimplifyCompiledFormula( pFormula2, nVal2, bIsStr2, aStrVal2 );
|
||||
bRelRef2 = lcl_HasRelRef( mpDoc, pFormula2.get() );
|
||||
bRelRef2 = lcl_HasRelRef( mrDoc, pFormula2.get() );
|
||||
}
|
||||
|
||||
StartListening();
|
||||
@@ -353,16 +353,16 @@ void ScConditionEntry::Compile( const OUString& rExpr1, const OUString& rExpr2,
|
||||
{
|
||||
if ( !rExpr1.isEmpty() || !rExpr2.isEmpty() )
|
||||
{
|
||||
ScCompiler aComp( *mpDoc, aSrcPos );
|
||||
ScCompiler aComp( mrDoc, aSrcPos );
|
||||
|
||||
if ( !rExpr1.isEmpty() )
|
||||
{
|
||||
pFormula1.reset();
|
||||
aComp.SetGrammar( eGrammar1 );
|
||||
if ( mpDoc->IsImportingXML() && !bTextToReal )
|
||||
if ( mrDoc.IsImportingXML() && !bTextToReal )
|
||||
{
|
||||
// temporary formula string as string tokens
|
||||
pFormula1.reset( new ScTokenArray(*mpDoc) );
|
||||
pFormula1.reset( new ScTokenArray(mrDoc) );
|
||||
pFormula1->AssignXMLString( rExpr1, rExprNmsp1 );
|
||||
// bRelRef1 is set when the formula is compiled again (CompileXML)
|
||||
}
|
||||
@@ -370,7 +370,7 @@ void ScConditionEntry::Compile( const OUString& rExpr1, const OUString& rExpr2,
|
||||
{
|
||||
pFormula1 = aComp.CompileString( rExpr1, rExprNmsp1 );
|
||||
SimplifyCompiledFormula( pFormula1, nVal1, bIsStr1, aStrVal1 );
|
||||
bRelRef1 = lcl_HasRelRef( mpDoc, pFormula1.get() );
|
||||
bRelRef1 = lcl_HasRelRef( mrDoc, pFormula1.get() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -378,10 +378,10 @@ void ScConditionEntry::Compile( const OUString& rExpr1, const OUString& rExpr2,
|
||||
{
|
||||
pFormula2.reset();
|
||||
aComp.SetGrammar( eGrammar2 );
|
||||
if ( mpDoc->IsImportingXML() && !bTextToReal )
|
||||
if ( mrDoc.IsImportingXML() && !bTextToReal )
|
||||
{
|
||||
// temporary formula string as string tokens
|
||||
pFormula2.reset( new ScTokenArray(*mpDoc) );
|
||||
pFormula2.reset( new ScTokenArray(mrDoc) );
|
||||
pFormula2->AssignXMLString( rExpr2, rExprNmsp2 );
|
||||
// bRelRef2 is set when the formula is compiled again (CompileXML)
|
||||
}
|
||||
@@ -389,7 +389,7 @@ void ScConditionEntry::Compile( const OUString& rExpr1, const OUString& rExpr2,
|
||||
{
|
||||
pFormula2 = aComp.CompileString( rExpr2, rExprNmsp2 );
|
||||
SimplifyCompiledFormula( pFormula2, nVal2, bIsStr2, aStrVal2 );
|
||||
bRelRef2 = lcl_HasRelRef( mpDoc, pFormula2.get() );
|
||||
bRelRef2 = lcl_HasRelRef( mrDoc, pFormula2.get() );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -402,25 +402,25 @@ void ScConditionEntry::Compile( const OUString& rExpr1, const OUString& rExpr2,
|
||||
*/
|
||||
void ScConditionEntry::MakeCells( const ScAddress& rPos )
|
||||
{
|
||||
if ( mpDoc->IsClipOrUndo() ) // Never calculate in the Clipboard!
|
||||
if ( mrDoc.IsClipOrUndo() ) // Never calculate in the Clipboard!
|
||||
return;
|
||||
|
||||
if ( pFormula1 && !pFCell1 && !bRelRef1 )
|
||||
{
|
||||
// pFCell1 will hold a flat-copied ScTokenArray sharing ref-counted
|
||||
// code tokens with pFormula1
|
||||
pFCell1.reset( new ScFormulaCell(*mpDoc, rPos, *pFormula1) );
|
||||
pFCell1.reset( new ScFormulaCell(mrDoc, rPos, *pFormula1) );
|
||||
pFCell1->SetFreeFlying(true);
|
||||
pFCell1->StartListeningTo( *mpDoc );
|
||||
pFCell1->StartListeningTo( mrDoc );
|
||||
}
|
||||
|
||||
if ( pFormula2 && !pFCell2 && !bRelRef2 )
|
||||
{
|
||||
// pFCell2 will hold a flat-copied ScTokenArray sharing ref-counted
|
||||
// code tokens with pFormula2
|
||||
pFCell2.reset( new ScFormulaCell(*mpDoc, rPos, *pFormula2) );
|
||||
pFCell2.reset( new ScFormulaCell(mrDoc, rPos, *pFormula2) );
|
||||
pFCell2->SetFreeFlying(true);
|
||||
pFCell2->StartListeningTo( *mpDoc );
|
||||
pFCell2->StartListeningTo( mrDoc );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -461,7 +461,7 @@ void ScConditionEntry::CompileXML()
|
||||
ScAddress aNew;
|
||||
/* XML is always in OOo:A1 format, although R1C1 would be more amenable
|
||||
* to compression */
|
||||
if ( aNew.Parse( aSrcString, *mpDoc ) & ScRefFlags::VALID )
|
||||
if ( aNew.Parse( aSrcString, mrDoc ) & ScRefFlags::VALID )
|
||||
aSrcPos = aNew;
|
||||
// if the position is invalid, there isn't much we can do at this time
|
||||
aSrcString.clear();
|
||||
@@ -474,15 +474,15 @@ void ScConditionEntry::CompileXML()
|
||||
|
||||
// Importing ocDde/ocWebservice?
|
||||
if (pFormula1)
|
||||
mpDoc->CheckLinkFormulaNeedingCheck(*pFormula1);
|
||||
mrDoc.CheckLinkFormulaNeedingCheck(*pFormula1);
|
||||
if (pFormula2)
|
||||
mpDoc->CheckLinkFormulaNeedingCheck(*pFormula2);
|
||||
mrDoc.CheckLinkFormulaNeedingCheck(*pFormula2);
|
||||
}
|
||||
|
||||
void ScConditionEntry::SetSrcString( const OUString& rNew )
|
||||
{
|
||||
// aSrcString is only evaluated in CompileXML
|
||||
SAL_WARN_IF( !mpDoc->IsImportingXML(), "sc", "SetSrcString is only valid for XML import" );
|
||||
SAL_WARN_IF( !mrDoc.IsImportingXML(), "sc", "SetSrcString is only valid for XML import" );
|
||||
|
||||
aSrcString = rNew;
|
||||
}
|
||||
@@ -494,7 +494,7 @@ void ScConditionEntry::SetFormula1( const ScTokenArray& rArray )
|
||||
{
|
||||
pFormula1.reset( new ScTokenArray( rArray ) );
|
||||
SimplifyCompiledFormula(pFormula1, nVal1, bIsStr1, aStrVal1);
|
||||
bRelRef1 = lcl_HasRelRef( mpDoc, pFormula1.get() );
|
||||
bRelRef1 = lcl_HasRelRef( mrDoc, pFormula1.get() );
|
||||
}
|
||||
|
||||
StartListening();
|
||||
@@ -507,7 +507,7 @@ void ScConditionEntry::SetFormula2( const ScTokenArray& rArray )
|
||||
{
|
||||
pFormula2.reset( new ScTokenArray( rArray ) );
|
||||
SimplifyCompiledFormula(pFormula2, nVal2, bIsStr2, aStrVal2);
|
||||
bRelRef2 = lcl_HasRelRef( mpDoc, pFormula2.get() );
|
||||
bRelRef2 = lcl_HasRelRef( mrDoc, pFormula2.get() );
|
||||
}
|
||||
|
||||
StartListening();
|
||||
@@ -522,7 +522,7 @@ void ScConditionEntry::UpdateReference( sc::RefUpdateContext& rCxt )
|
||||
if (rCxt.meMode == URM_INSDEL && rCxt.maRange.Contains(aSrcPos))
|
||||
{
|
||||
ScAddress aErrorPos( ScAddress::UNINITIALIZED );
|
||||
if (!aSrcPos.Move(rCxt.mnColDelta, rCxt.mnRowDelta, rCxt.mnTabDelta, aErrorPos, *mpDoc))
|
||||
if (!aSrcPos.Move(rCxt.mnColDelta, rCxt.mnRowDelta, rCxt.mnTabDelta, aErrorPos, mrDoc))
|
||||
{
|
||||
assert(!"can't move ScConditionEntry");
|
||||
}
|
||||
@@ -684,9 +684,9 @@ void ScConditionEntry::Interpret( const ScAddress& rPos )
|
||||
if ( bRelRef1 )
|
||||
{
|
||||
if (pFormula1)
|
||||
oTemp.emplace(*mpDoc, rPos, *pFormula1);
|
||||
oTemp.emplace(mrDoc, rPos, *pFormula1);
|
||||
else
|
||||
oTemp.emplace(*mpDoc, rPos);
|
||||
oTemp.emplace(mrDoc, rPos);
|
||||
pEff1 = &*oTemp;
|
||||
pEff1->SetFreeFlying(true);
|
||||
}
|
||||
@@ -695,7 +695,7 @@ void ScConditionEntry::Interpret( const ScAddress& rPos )
|
||||
if (!pEff1->IsRunning()) // Don't create 522
|
||||
{
|
||||
//TODO: Query Changed instead of Dirty!
|
||||
if (pEff1->GetDirty() && !bRelRef1 && mpDoc->GetAutoCalc())
|
||||
if (pEff1->GetDirty() && !bRelRef1 && mrDoc.GetAutoCalc())
|
||||
bDirty = true;
|
||||
if (pEff1->IsValue())
|
||||
{
|
||||
@@ -717,9 +717,9 @@ void ScConditionEntry::Interpret( const ScAddress& rPos )
|
||||
if ( bRelRef2 )
|
||||
{
|
||||
if (pFormula2)
|
||||
oTemp.emplace(*mpDoc, rPos, *pFormula2);
|
||||
oTemp.emplace(mrDoc, rPos, *pFormula2);
|
||||
else
|
||||
oTemp.emplace(*mpDoc, rPos);
|
||||
oTemp.emplace(mrDoc, rPos);
|
||||
pEff2 = &*oTemp;
|
||||
pEff2->SetFreeFlying(true);
|
||||
}
|
||||
@@ -727,7 +727,7 @@ void ScConditionEntry::Interpret( const ScAddress& rPos )
|
||||
{
|
||||
if (!pEff2->IsRunning()) // Don't create 522
|
||||
{
|
||||
if (pEff2->GetDirty() && !bRelRef2 && mpDoc->GetAutoCalc())
|
||||
if (pEff2->GetDirty() && !bRelRef2 && mrDoc.GetAutoCalc())
|
||||
bDirty = true;
|
||||
if (pEff2->IsValue())
|
||||
{
|
||||
@@ -756,7 +756,7 @@ void ScConditionEntry::Interpret( const ScAddress& rPos )
|
||||
}
|
||||
|
||||
static bool lcl_GetCellContent( const ScRefCellValue& rCell, bool bIsStr1, double& rArg, OUString& rArgStr,
|
||||
const ScDocument* pDoc )
|
||||
const ScDocument& rDoc )
|
||||
{
|
||||
|
||||
if (rCell.isEmpty())
|
||||
@@ -784,7 +784,7 @@ static bool lcl_GetCellContent( const ScRefCellValue& rCell, bool bIsStr1, doubl
|
||||
if (rCell.getType() == CELLTYPE_STRING)
|
||||
rArgStr = rCell.getSharedString()->getString();
|
||||
else if (rCell.getEditText())
|
||||
rArgStr = ScEditUtil::GetString(*rCell.getEditText(), pDoc);
|
||||
rArgStr = ScEditUtil::GetString(*rCell.getEditText(), &rDoc);
|
||||
break;
|
||||
default:
|
||||
;
|
||||
@@ -812,23 +812,23 @@ void ScConditionEntry::FillCache() const
|
||||
|
||||
// temporary fix to workaround slow duplicate entry
|
||||
// conditions, prevent to use a whole row
|
||||
if(nRow == mpDoc->MaxRow())
|
||||
if(nRow == mrDoc.MaxRow())
|
||||
{
|
||||
bool bShrunk = false;
|
||||
mpDoc->ShrinkToUsedDataArea(bShrunk, nTab, nColStart, nRowStart,
|
||||
mrDoc.ShrinkToUsedDataArea(bShrunk, nTab, nColStart, nRowStart,
|
||||
nCol, nRow, false);
|
||||
}
|
||||
|
||||
for( SCROW r = nRowStart; r <= nRow; r++ )
|
||||
for( SCCOL c = nColStart; c <= nCol; c++ )
|
||||
{
|
||||
ScRefCellValue aCell(*mpDoc, ScAddress(c, r, nTab));
|
||||
ScRefCellValue aCell(mrDoc, ScAddress(c, r, nTab));
|
||||
if (aCell.isEmpty())
|
||||
continue;
|
||||
|
||||
double nVal = 0.0;
|
||||
OUString aStr;
|
||||
if (!lcl_GetCellContent(aCell, false, nVal, aStr, mpDoc))
|
||||
if (!lcl_GetCellContent(aCell, false, nVal, aStr, mrDoc))
|
||||
{
|
||||
std::pair<ScConditionEntryCache::StringCacheType::iterator, bool> aResult =
|
||||
mpCache->maStrings.emplace(aStr, 1);
|
||||
@@ -984,7 +984,7 @@ bool ScConditionEntry::IsAboveAverage( double nArg, bool bEqual ) const
|
||||
|
||||
bool ScConditionEntry::IsError( const ScAddress& rPos ) const
|
||||
{
|
||||
ScRefCellValue rCell(*mpDoc, rPos);
|
||||
ScRefCellValue rCell(mrDoc, rPos);
|
||||
|
||||
if (rCell.getType() == CELLTYPE_FORMULA)
|
||||
{
|
||||
@@ -1270,7 +1270,7 @@ bool ScConditionEntry::IsCellValid( const ScRefCellValue& rCell, const ScAddress
|
||||
|
||||
double nArg = 0.0;
|
||||
OUString aArgStr;
|
||||
bool bVal = lcl_GetCellContent( rCell, bIsStr1, nArg, aArgStr, mpDoc );
|
||||
bool bVal = lcl_GetCellContent( rCell, bIsStr1, nArg, aArgStr, mrDoc );
|
||||
if (bVal)
|
||||
return IsValid( nArg, rPos );
|
||||
else
|
||||
@@ -1285,13 +1285,13 @@ OUString ScConditionEntry::GetExpression( const ScAddress& rCursor, sal_uInt16 n
|
||||
OUString aRet;
|
||||
|
||||
if ( FormulaGrammar::isEnglish( eGrammar) && nNumFmt == 0 )
|
||||
nNumFmt = mpDoc->GetFormatTable()->GetStandardIndex( LANGUAGE_ENGLISH_US );
|
||||
nNumFmt = mrDoc.GetFormatTable()->GetStandardIndex( LANGUAGE_ENGLISH_US );
|
||||
|
||||
if ( nIndex==0 )
|
||||
{
|
||||
if ( pFormula1 )
|
||||
{
|
||||
ScCompiler aComp(*mpDoc, rCursor, *pFormula1, eGrammar);
|
||||
ScCompiler aComp(mrDoc, rCursor, *pFormula1, eGrammar);
|
||||
OUStringBuffer aBuffer;
|
||||
aComp.CreateStringFromTokenArray( aBuffer );
|
||||
aRet = aBuffer.makeStringAndClear();
|
||||
@@ -1301,13 +1301,13 @@ OUString ScConditionEntry::GetExpression( const ScAddress& rCursor, sal_uInt16 n
|
||||
aRet = "\"" + aStrVal1 + "\"";
|
||||
}
|
||||
else
|
||||
aRet = mpDoc->GetFormatTable()->GetInputLineString(nVal1, nNumFmt);
|
||||
aRet = mrDoc.GetFormatTable()->GetInputLineString(nVal1, nNumFmt);
|
||||
}
|
||||
else if ( nIndex==1 )
|
||||
{
|
||||
if ( pFormula2 )
|
||||
{
|
||||
ScCompiler aComp(*mpDoc, rCursor, *pFormula2, eGrammar);
|
||||
ScCompiler aComp(mrDoc, rCursor, *pFormula2, eGrammar);
|
||||
OUStringBuffer aBuffer;
|
||||
aComp.CreateStringFromTokenArray( aBuffer );
|
||||
aRet = aBuffer.makeStringAndClear();
|
||||
@@ -1317,7 +1317,7 @@ OUString ScConditionEntry::GetExpression( const ScAddress& rCursor, sal_uInt16 n
|
||||
aRet = "\"" + aStrVal2 + "\"";
|
||||
}
|
||||
else
|
||||
aRet = mpDoc->GetFormatTable()->GetInputLineString(nVal2, nNumFmt);
|
||||
aRet = mrDoc.GetFormatTable()->GetInputLineString(nVal2, nNumFmt);
|
||||
}
|
||||
|
||||
return aRet;
|
||||
@@ -1334,10 +1334,10 @@ std::unique_ptr<ScTokenArray> ScConditionEntry::CreateFlatCopiedTokenArray( sal_
|
||||
pRet.reset(new ScTokenArray( *pFormula1 ));
|
||||
else
|
||||
{
|
||||
pRet.reset(new ScTokenArray(*mpDoc));
|
||||
pRet.reset(new ScTokenArray(mrDoc));
|
||||
if (bIsStr1)
|
||||
{
|
||||
svl::SharedStringPool& rSPool = mpDoc->GetSharedStringPool();
|
||||
svl::SharedStringPool& rSPool = mrDoc.GetSharedStringPool();
|
||||
pRet->AddString(rSPool.intern(aStrVal1));
|
||||
}
|
||||
else
|
||||
@@ -1350,10 +1350,10 @@ std::unique_ptr<ScTokenArray> ScConditionEntry::CreateFlatCopiedTokenArray( sal_
|
||||
pRet.reset(new ScTokenArray( *pFormula2 ));
|
||||
else
|
||||
{
|
||||
pRet.reset(new ScTokenArray(*mpDoc));
|
||||
pRet.reset(new ScTokenArray(mrDoc));
|
||||
if (bIsStr2)
|
||||
{
|
||||
svl::SharedStringPool& rSPool = mpDoc->GetSharedStringPool();
|
||||
svl::SharedStringPool& rSPool = mrDoc.GetSharedStringPool();
|
||||
pRet->AddString(rSPool.intern(aStrVal2));
|
||||
}
|
||||
else
|
||||
@@ -1381,7 +1381,7 @@ ScAddress ScConditionEntry::GetValidSrcPos() const
|
||||
for ( auto t: pFormula->References() )
|
||||
{
|
||||
ScSingleRefData& rRef1 = *t->GetSingleRef();
|
||||
ScAddress aAbs = rRef1.toAbs(*mpDoc, aSrcPos);
|
||||
ScAddress aAbs = rRef1.toAbs(mrDoc, aSrcPos);
|
||||
if (!rRef1.IsTabDeleted())
|
||||
{
|
||||
if (aAbs.Tab() < nMinTab)
|
||||
@@ -1392,7 +1392,7 @@ ScAddress ScConditionEntry::GetValidSrcPos() const
|
||||
if ( t->GetType() == svDoubleRef )
|
||||
{
|
||||
ScSingleRefData& rRef2 = t->GetDoubleRef()->Ref2;
|
||||
aAbs = rRef2.toAbs(*mpDoc, aSrcPos);
|
||||
aAbs = rRef2.toAbs(mrDoc, aSrcPos);
|
||||
if (!rRef2.IsTabDeleted())
|
||||
{
|
||||
if (aAbs.Tab() < nMinTab)
|
||||
@@ -1406,7 +1406,7 @@ ScAddress ScConditionEntry::GetValidSrcPos() const
|
||||
}
|
||||
|
||||
ScAddress aValidPos = aSrcPos;
|
||||
SCTAB nTabCount = mpDoc->GetTableCount();
|
||||
SCTAB nTabCount = mrDoc.GetTableCount();
|
||||
if ( nMaxTab >= nTabCount && nMinTab > 0 )
|
||||
aValidPos.SetTab( aSrcPos.Tab() - nMinTab ); // so the lowest tab ref will be on 0
|
||||
|
||||
@@ -1428,14 +1428,14 @@ bool ScConditionEntry::MarkUsedExternalReferences() const
|
||||
{
|
||||
ScTokenArray* pFormula = nPass ? pFormula2.get() : pFormula1.get();
|
||||
if (pFormula)
|
||||
bAllMarked = mpDoc->MarkUsedExternalReferences(*pFormula, aSrcPos);
|
||||
bAllMarked = mrDoc.MarkUsedExternalReferences(*pFormula, aSrcPos);
|
||||
}
|
||||
return bAllMarked;
|
||||
}
|
||||
|
||||
ScFormatEntry* ScConditionEntry::Clone(ScDocument* pDoc) const
|
||||
ScFormatEntry* ScConditionEntry::Clone(ScDocument& rDoc) const
|
||||
{
|
||||
return new ScConditionEntry(*pDoc, *this);
|
||||
return new ScConditionEntry(rDoc, *this);
|
||||
}
|
||||
|
||||
ScConditionMode ScConditionEntry::GetModeFromApi(css::sheet::ConditionOperator nOperation)
|
||||
@@ -1551,9 +1551,9 @@ void ScCondFormatEntry::DataChanged() const
|
||||
pCondFormat->DoRepaint();
|
||||
}
|
||||
|
||||
ScFormatEntry* ScCondFormatEntry::Clone( ScDocument* pDoc ) const
|
||||
ScFormatEntry* ScCondFormatEntry::Clone( ScDocument& rDoc ) const
|
||||
{
|
||||
return new ScCondFormatEntry( *pDoc, *this );
|
||||
return new ScCondFormatEntry(rDoc, *this );
|
||||
}
|
||||
|
||||
void ScConditionEntry::CalcAll()
|
||||
@@ -1568,14 +1568,14 @@ void ScConditionEntry::CalcAll()
|
||||
}
|
||||
}
|
||||
|
||||
ScCondDateFormatEntry::ScCondDateFormatEntry( ScDocument* pDoc )
|
||||
: ScFormatEntry( pDoc )
|
||||
ScCondDateFormatEntry::ScCondDateFormatEntry( ScDocument& rDoc )
|
||||
: ScFormatEntry( rDoc )
|
||||
, meType(condformat::TODAY)
|
||||
{
|
||||
}
|
||||
|
||||
ScCondDateFormatEntry::ScCondDateFormatEntry( ScDocument* pDoc, const ScCondDateFormatEntry& rFormat ):
|
||||
ScFormatEntry( pDoc ),
|
||||
ScCondDateFormatEntry::ScCondDateFormatEntry( ScDocument& rDoc, const ScCondDateFormatEntry& rFormat ):
|
||||
ScFormatEntry( rDoc ),
|
||||
meType( rFormat.meType ),
|
||||
maStyleName( rFormat.maStyleName )
|
||||
{
|
||||
@@ -1583,7 +1583,7 @@ ScCondDateFormatEntry::ScCondDateFormatEntry( ScDocument* pDoc, const ScCondDate
|
||||
|
||||
bool ScCondDateFormatEntry::IsValid( const ScAddress& rPos ) const
|
||||
{
|
||||
ScRefCellValue rCell(*mpDoc, rPos);
|
||||
ScRefCellValue rCell(mrDoc, rPos);
|
||||
|
||||
if (!rCell.hasNumeric())
|
||||
// non-numerical cell.
|
||||
@@ -1593,7 +1593,7 @@ bool ScCondDateFormatEntry::IsValid( const ScAddress& rPos ) const
|
||||
mpCache.reset( new Date( Date::SYSTEM ) );
|
||||
|
||||
const Date& rActDate = *mpCache;
|
||||
SvNumberFormatter* pFormatter = mpDoc->GetFormatTable();
|
||||
SvNumberFormatter* pFormatter = mrDoc.GetFormatTable();
|
||||
sal_Int32 nCurrentDate = rActDate - pFormatter->GetNullDate();
|
||||
|
||||
double nVal = rCell.getValue();
|
||||
@@ -1724,9 +1724,9 @@ void ScCondDateFormatEntry::SetStyleName( const OUString& rStyleName )
|
||||
maStyleName = rStyleName;
|
||||
}
|
||||
|
||||
ScFormatEntry* ScCondDateFormatEntry::Clone( ScDocument* pDoc ) const
|
||||
ScFormatEntry* ScCondDateFormatEntry::Clone( ScDocument& rDoc ) const
|
||||
{
|
||||
return new ScCondDateFormatEntry( pDoc, *this );
|
||||
return new ScCondDateFormatEntry(rDoc, *this );
|
||||
}
|
||||
|
||||
void ScCondDateFormatEntry::startRendering()
|
||||
@@ -1769,8 +1769,8 @@ void ScColorFormatCache::Notify(const SfxHint& rHint)
|
||||
}
|
||||
|
||||
|
||||
ScConditionalFormat::ScConditionalFormat(sal_uInt32 nNewKey, ScDocument* pDocument) :
|
||||
mpDoc( pDocument ),
|
||||
ScConditionalFormat::ScConditionalFormat(sal_uInt32 nNewKey, ScDocument& rDocument) :
|
||||
mrDoc( rDocument ),
|
||||
mnKey( nNewKey )
|
||||
{
|
||||
}
|
||||
@@ -1779,14 +1779,14 @@ std::unique_ptr<ScConditionalFormat> ScConditionalFormat::Clone(ScDocument* pNew
|
||||
{
|
||||
// Real copy of the formula (for Ref Undo/between documents)
|
||||
if (!pNewDoc)
|
||||
pNewDoc = mpDoc;
|
||||
pNewDoc = &mrDoc;
|
||||
|
||||
std::unique_ptr<ScConditionalFormat> pNew(new ScConditionalFormat(mnKey, pNewDoc));
|
||||
std::unique_ptr<ScConditionalFormat> pNew(new ScConditionalFormat(mnKey, *pNewDoc));
|
||||
pNew->SetRange( maRanges ); // prerequisite for listeners
|
||||
|
||||
for (const auto& rxEntry : maEntries)
|
||||
{
|
||||
ScFormatEntry* pNewEntry = rxEntry->Clone(pNewDoc);
|
||||
ScFormatEntry* pNewEntry = rxEntry->Clone(*pNewDoc);
|
||||
pNew->maEntries.push_back( std::unique_ptr<ScFormatEntry>(pNewEntry) );
|
||||
pNewEntry->SetParent(pNew.get());
|
||||
}
|
||||
@@ -1845,9 +1845,9 @@ size_t ScConditionalFormat::size() const
|
||||
return maEntries.size();
|
||||
}
|
||||
|
||||
ScDocument* ScConditionalFormat::GetDocument()
|
||||
ScDocument& ScConditionalFormat::GetDocument()
|
||||
{
|
||||
return mpDoc;
|
||||
return mrDoc;
|
||||
}
|
||||
|
||||
ScConditionalFormat::~ScConditionalFormat()
|
||||
@@ -1925,7 +1925,7 @@ ScCondFormatData ScConditionalFormat::GetData( const ScRefCellValue& rCell, cons
|
||||
void ScConditionalFormat::DoRepaint()
|
||||
{
|
||||
// all conditional format cells
|
||||
mpDoc->RepaintRange( maRanges );
|
||||
mrDoc.RepaintRange( maRanges );
|
||||
}
|
||||
|
||||
void ScConditionalFormat::CompileAll()
|
||||
@@ -1951,7 +1951,7 @@ void ScConditionalFormat::UpdateReference( sc::RefUpdateContext& rCxt, bool bCop
|
||||
// ScConditionEntry::UpdateReference() obtains its aSrcPos from
|
||||
// maRanges and does not update it on URM_COPY, but it's needed later
|
||||
// for the moved position, so update maRanges beforehand.
|
||||
maRanges.UpdateReference(URM_MOVE, mpDoc, rCxt.maRange, rCxt.mnColDelta, rCxt.mnRowDelta, rCxt.mnTabDelta);
|
||||
maRanges.UpdateReference(URM_MOVE, mrDoc, rCxt.maRange, rCxt.mnColDelta, rCxt.mnRowDelta, rCxt.mnTabDelta);
|
||||
for (auto& rxEntry : maEntries)
|
||||
rxEntry->UpdateReference(rCxt);
|
||||
}
|
||||
@@ -1959,7 +1959,7 @@ void ScConditionalFormat::UpdateReference( sc::RefUpdateContext& rCxt, bool bCop
|
||||
{
|
||||
for (auto& rxEntry : maEntries)
|
||||
rxEntry->UpdateReference(rCxt);
|
||||
maRanges.UpdateReference(rCxt.meMode, mpDoc, rCxt.maRange, rCxt.mnColDelta, rCxt.mnRowDelta, rCxt.mnTabDelta);
|
||||
maRanges.UpdateReference(rCxt.meMode, mrDoc, rCxt.maRange, rCxt.mnColDelta, rCxt.mnRowDelta, rCxt.mnTabDelta);
|
||||
}
|
||||
|
||||
ResetCache();
|
||||
@@ -2146,8 +2146,8 @@ void ScConditionalFormat::CalcAll()
|
||||
|
||||
void ScConditionalFormat::ResetCache() const
|
||||
{
|
||||
if (!maRanges.empty() && mpDoc)
|
||||
mpCache = std::make_unique<ScColorFormatCache>(*mpDoc, maRanges);
|
||||
if (!maRanges.empty())
|
||||
mpCache = std::make_unique<ScColorFormatCache>(mrDoc, maRanges);
|
||||
else
|
||||
mpCache.reset();
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ ScDocument::ScDocument( ScDocumentMode eMode, ScDocShell* pDocShell ) :
|
||||
{
|
||||
mxPoolHelper = new ScPoolHelper( *this );
|
||||
if (!comphelper::IsFuzzing()) //just too slow
|
||||
pBASM.reset( new ScBroadcastAreaSlotMachine( this ) );
|
||||
pBASM.reset( new ScBroadcastAreaSlotMachine( *this ) );
|
||||
pChartListenerCollection.reset( new ScChartListenerCollection( *this ) );
|
||||
pRefreshTimerControl.reset( new ScRefreshTimerControl );
|
||||
}
|
||||
@@ -777,12 +777,12 @@ bool ScDocument::MoveTab( SCTAB nOldPos, SCTAB nNewPos, ScProgress* pProgress )
|
||||
pRangeName->UpdateMoveTab(aCxt);
|
||||
|
||||
pDBCollection->UpdateMoveTab( nOldPos, nNewPos );
|
||||
xColNameRanges->UpdateReference( URM_REORDER, this, aSourceRange, 0,0,nDz );
|
||||
xRowNameRanges->UpdateReference( URM_REORDER, this, aSourceRange, 0,0,nDz );
|
||||
xColNameRanges->UpdateReference( URM_REORDER, *this, aSourceRange, 0,0,nDz );
|
||||
xRowNameRanges->UpdateReference( URM_REORDER, *this, aSourceRange, 0,0,nDz );
|
||||
if (pDPCollection)
|
||||
pDPCollection->UpdateReference( URM_REORDER, aSourceRange, 0,0,nDz );
|
||||
if (pDetOpList)
|
||||
pDetOpList->UpdateReference( this, URM_REORDER, aSourceRange, 0,0,nDz );
|
||||
pDetOpList->UpdateReference( *this, URM_REORDER, aSourceRange, 0,0,nDz );
|
||||
UpdateChartRef( URM_REORDER,
|
||||
0,0,nOldPos, MaxCol(),MaxRow(),nOldPos, 0,0,nDz );
|
||||
UpdateRefAreaLinks( URM_REORDER, aSourceRange, 0,0,nDz );
|
||||
@@ -853,8 +853,8 @@ bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM
|
||||
SetNoListening( true );
|
||||
|
||||
ScRange aRange( 0,0,nNewPos, MaxCol(),MaxRow(),MAXTAB );
|
||||
xColNameRanges->UpdateReference( URM_INSDEL, this, aRange, 0,0,1 );
|
||||
xRowNameRanges->UpdateReference( URM_INSDEL, this, aRange, 0,0,1 );
|
||||
xColNameRanges->UpdateReference( URM_INSDEL, *this, aRange, 0,0,1 );
|
||||
xRowNameRanges->UpdateReference( URM_INSDEL, *this, aRange, 0,0,1 );
|
||||
if (pRangeName)
|
||||
pRangeName->UpdateInsertTab(aCxt);
|
||||
|
||||
@@ -863,7 +863,7 @@ bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM
|
||||
if (pDPCollection)
|
||||
pDPCollection->UpdateReference( URM_INSDEL, aRange, 0,0,1 );
|
||||
if (pDetOpList)
|
||||
pDetOpList->UpdateReference( this, URM_INSDEL, aRange, 0,0,1 );
|
||||
pDetOpList->UpdateReference( *this, URM_INSDEL, aRange, 0,0,1 );
|
||||
UpdateChartRef( URM_INSDEL, 0,0,nNewPos, MaxCol(),MaxRow(),MAXTAB, 0,0,1 );
|
||||
UpdateRefAreaLinks( URM_INSDEL, aRange, 0,0,1 );
|
||||
if ( pUnoBroadcaster )
|
||||
|
||||
@@ -1042,8 +1042,8 @@ void ScDocument::UpdateReference(
|
||||
SCROW nRow1 = rCxt.maRange.aStart.Row(), nRow2 = rCxt.maRange.aEnd.Row();
|
||||
SCTAB nTab1 = rCxt.maRange.aStart.Tab(), nTab2 = rCxt.maRange.aEnd.Tab();
|
||||
|
||||
xColNameRanges->UpdateReference( eUpdateRefMode, this, aRange, nDx, nDy, nDz );
|
||||
xRowNameRanges->UpdateReference( eUpdateRefMode, this, aRange, nDx, nDy, nDz );
|
||||
xColNameRanges->UpdateReference( eUpdateRefMode, *this, aRange, nDx, nDy, nDz );
|
||||
xRowNameRanges->UpdateReference( eUpdateRefMode, *this, aRange, nDx, nDy, nDz );
|
||||
pDBCollection->UpdateReference( eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, nDx, nDy, nDz );
|
||||
if (pRangeName)
|
||||
pRangeName->UpdateReference(rCxt);
|
||||
@@ -1057,7 +1057,7 @@ void ScDocument::UpdateReference(
|
||||
pValidationList->UpdateReference(rCxt);
|
||||
}
|
||||
if ( pDetOpList )
|
||||
pDetOpList->UpdateReference( this, eUpdateRefMode, aRange, nDx, nDy, nDz );
|
||||
pDetOpList->UpdateReference( *this, eUpdateRefMode, aRange, nDx, nDy, nDz );
|
||||
if ( pUnoBroadcaster )
|
||||
pUnoBroadcaster->Broadcast( ScUpdateRefHint(
|
||||
eUpdateRefMode, aRange, nDx, nDy, nDz ) );
|
||||
@@ -1098,7 +1098,7 @@ void ScDocument::UpdateReference(
|
||||
SCROW nRow1 = rCxt.maRange.aStart.Row(), nRow2 = rCxt.maRange.aEnd.Row();
|
||||
SCTAB nTab1 = rCxt.maRange.aStart.Tab(), nTab2 = rCxt.maRange.aEnd.Tab();
|
||||
|
||||
if ( ScRefUpdate::Update( this, eUpdateRefMode, nCol1,nRow1,nTab1, nCol2,nRow2,nTab2,
|
||||
if ( ScRefUpdate::Update( *this, eUpdateRefMode, nCol1,nRow1,nTab1, nCol2,nRow2,nTab2,
|
||||
nDx,nDy,nDz, theCol1,theRow1,theTab1, theCol2,theRow2,theTab2 ) )
|
||||
{
|
||||
aEmbedRange = ScRange( theCol1,theRow1,theTab1, theCol2,theRow2,theTab2 );
|
||||
|
||||
@@ -730,7 +730,7 @@ sal_uInt32 ScDocument::AddValidationEntry( const ScValidationData& rNew )
|
||||
|
||||
// might be called from ScPatternAttr::MigrateToDocument; thus clone (real copy)
|
||||
sal_uInt32 nNewKey = nMax + 1;
|
||||
std::unique_ptr<ScValidationData> pInsert(rNew.Clone(this));
|
||||
std::unique_ptr<ScValidationData> pInsert(rNew.Clone(*this));
|
||||
pInsert->SetKey( nNewKey );
|
||||
ScMutationGuard aGuard(*this, ScMutationGuardFlags::CORE);
|
||||
pValidationList->InsertNew( std::move(pInsert) );
|
||||
|
||||
@@ -417,7 +417,7 @@ void ScDocument::UpdateChartRef( UpdateRefMode eUpdateRefMode,
|
||||
SCROW theRow2 = rRange.aEnd.Row();
|
||||
SCTAB theTab2 = rRange.aEnd.Tab();
|
||||
ScRefUpdateRes eRes = ScRefUpdate::Update(
|
||||
this, eUpdateRefMode,
|
||||
*this, eUpdateRefMode,
|
||||
nCol1,nRow1,nTab1, nCol2,nRow2,nTab2,
|
||||
nDx,nDy,nDz,
|
||||
theCol1,theRow1,theTab1,
|
||||
|
||||
@@ -1103,7 +1103,7 @@ void ScDocument::UpdateRefAreaLinks( UpdateRefMode eUpdateRefMode,
|
||||
SCTAB nTab2 = aOutRange.aEnd.Tab();
|
||||
|
||||
ScRefUpdateRes eRes =
|
||||
ScRefUpdate::Update( this, eUpdateRefMode,
|
||||
ScRefUpdate::Update( *this, eUpdateRefMode,
|
||||
rRange.aStart.Col(), rRange.aStart.Row(), rRange.aStart.Tab(),
|
||||
rRange.aEnd.Col(), rRange.aEnd.Row(), rRange.aEnd.Tab(), nDx, nDy, nDz,
|
||||
nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
|
||||
|
||||
@@ -516,8 +516,8 @@ bool ScDocument::InsertTab(
|
||||
sc::RefUpdateInsertTabContext aCxt( *this, nPos, 1);
|
||||
|
||||
ScRange aRange( 0,0,nPos, MaxCol(),MaxRow(),MAXTAB );
|
||||
xColNameRanges->UpdateReference( URM_INSDEL, this, aRange, 0,0,1 );
|
||||
xRowNameRanges->UpdateReference( URM_INSDEL, this, aRange, 0,0,1 );
|
||||
xColNameRanges->UpdateReference( URM_INSDEL, *this, aRange, 0,0,1 );
|
||||
xRowNameRanges->UpdateReference( URM_INSDEL, *this, aRange, 0,0,1 );
|
||||
if (pRangeName)
|
||||
pRangeName->UpdateInsertTab(aCxt);
|
||||
pDBCollection->UpdateReference(
|
||||
@@ -525,7 +525,7 @@ bool ScDocument::InsertTab(
|
||||
if (pDPCollection)
|
||||
pDPCollection->UpdateReference( URM_INSDEL, aRange, 0,0,1 );
|
||||
if (pDetOpList)
|
||||
pDetOpList->UpdateReference( this, URM_INSDEL, aRange, 0,0,1 );
|
||||
pDetOpList->UpdateReference( *this, URM_INSDEL, aRange, 0,0,1 );
|
||||
UpdateChartRef( URM_INSDEL, 0,0,nPos, MaxCol(),MaxRow(),MAXTAB, 0,0,1 );
|
||||
UpdateRefAreaLinks( URM_INSDEL, aRange, 0,0,1 );
|
||||
if ( pUnoBroadcaster )
|
||||
@@ -603,8 +603,8 @@ bool ScDocument::InsertTabs( SCTAB nPos, const std::vector<OUString>& rNames,
|
||||
{
|
||||
sc::RefUpdateInsertTabContext aCxt( *this, nPos, nNewSheets);
|
||||
ScRange aRange( 0,0,nPos, MaxCol(),MaxRow(),MAXTAB );
|
||||
xColNameRanges->UpdateReference( URM_INSDEL, this, aRange, 0,0,nNewSheets );
|
||||
xRowNameRanges->UpdateReference( URM_INSDEL, this, aRange, 0,0,nNewSheets );
|
||||
xColNameRanges->UpdateReference( URM_INSDEL, *this, aRange, 0,0,nNewSheets );
|
||||
xRowNameRanges->UpdateReference( URM_INSDEL, *this, aRange, 0,0,nNewSheets );
|
||||
if (pRangeName)
|
||||
pRangeName->UpdateInsertTab(aCxt);
|
||||
pDBCollection->UpdateReference(
|
||||
@@ -612,7 +612,7 @@ bool ScDocument::InsertTabs( SCTAB nPos, const std::vector<OUString>& rNames,
|
||||
if (pDPCollection)
|
||||
pDPCollection->UpdateReference( URM_INSDEL, aRange, 0,0,nNewSheets );
|
||||
if (pDetOpList)
|
||||
pDetOpList->UpdateReference( this, URM_INSDEL, aRange, 0,0,nNewSheets );
|
||||
pDetOpList->UpdateReference( *this, URM_INSDEL, aRange, 0,0,nNewSheets );
|
||||
UpdateChartRef( URM_INSDEL, 0,0,nPos, MaxCol(),MaxRow(),MAXTAB, 0,0,nNewSheets );
|
||||
UpdateRefAreaLinks( URM_INSDEL, aRange, 0,0, nNewSheets );
|
||||
if ( pUnoBroadcaster )
|
||||
@@ -692,8 +692,8 @@ bool ScDocument::DeleteTab( SCTAB nTab )
|
||||
// normal reference update
|
||||
|
||||
aRange.aEnd.SetTab(GetTableCount() - 1);
|
||||
xColNameRanges->UpdateReference( URM_INSDEL, this, aRange, 0,0,-1 );
|
||||
xRowNameRanges->UpdateReference( URM_INSDEL, this, aRange, 0,0,-1 );
|
||||
xColNameRanges->UpdateReference( URM_INSDEL, *this, aRange, 0,0,-1 );
|
||||
xRowNameRanges->UpdateReference( URM_INSDEL, *this, aRange, 0,0,-1 );
|
||||
if (pRangeName)
|
||||
pRangeName->UpdateDeleteTab(aCxt);
|
||||
pDBCollection->UpdateReference(
|
||||
@@ -701,7 +701,7 @@ bool ScDocument::DeleteTab( SCTAB nTab )
|
||||
if (pDPCollection)
|
||||
pDPCollection->UpdateReference( URM_INSDEL, aRange, 0,0,-1 );
|
||||
if (pDetOpList)
|
||||
pDetOpList->UpdateReference( this, URM_INSDEL, aRange, 0,0,-1 );
|
||||
pDetOpList->UpdateReference( *this, URM_INSDEL, aRange, 0,0,-1 );
|
||||
UpdateChartRef( URM_INSDEL, 0,0,nTab, MaxCol(),MaxRow(),MAXTAB, 0,0,-1 );
|
||||
UpdateRefAreaLinks( URM_INSDEL, aRange, 0,0,-1 );
|
||||
if (pValidationList)
|
||||
@@ -791,14 +791,14 @@ bool ScDocument::DeleteTabs( SCTAB nTab, SCTAB nSheets )
|
||||
// normal reference update
|
||||
|
||||
ScRange aRange( 0, 0, nTab, MaxCol(), MaxRow(), nTabCount - 1 );
|
||||
xColNameRanges->UpdateReference( URM_INSDEL, this, aRange, 0,0,-1*nSheets );
|
||||
xRowNameRanges->UpdateReference( URM_INSDEL, this, aRange, 0,0,-1*nSheets );
|
||||
xColNameRanges->UpdateReference( URM_INSDEL, *this, aRange, 0,0,-1*nSheets );
|
||||
xRowNameRanges->UpdateReference( URM_INSDEL, *this, aRange, 0,0,-1*nSheets );
|
||||
pDBCollection->UpdateReference(
|
||||
URM_INSDEL, 0,0,nTab, MaxCol(),MaxRow(),MAXTAB, 0,0,-1*nSheets );
|
||||
if (pDPCollection)
|
||||
pDPCollection->UpdateReference( URM_INSDEL, aRange, 0,0,-1*nSheets );
|
||||
if (pDetOpList)
|
||||
pDetOpList->UpdateReference( this, URM_INSDEL, aRange, 0,0,-1*nSheets );
|
||||
pDetOpList->UpdateReference( *this, URM_INSDEL, aRange, 0,0,-1*nSheets );
|
||||
UpdateChartRef( URM_INSDEL, 0,0,nTab, MaxCol(),MaxRow(),MAXTAB, 0,0,-1*nSheets );
|
||||
UpdateRefAreaLinks( URM_INSDEL, aRange, 0,0,-1*nSheets );
|
||||
if (pValidationList)
|
||||
|
||||
@@ -1075,7 +1075,7 @@ void ScDPObject::UpdateReference( UpdateRefMode eUpdateRefMode,
|
||||
SCTAB nTab2 = maOutputRange.aEnd.Tab();
|
||||
|
||||
ScRefUpdateRes eRes =
|
||||
ScRefUpdate::Update(mpDocument, eUpdateRefMode,
|
||||
ScRefUpdate::Update(*mpDocument, eUpdateRefMode,
|
||||
rRange.aStart.Col(), rRange.aStart.Row(), rRange.aStart.Tab(),
|
||||
rRange.aEnd.Col(), rRange.aEnd.Row(), rRange.aEnd.Tab(), nDx, nDy, nDz,
|
||||
nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
|
||||
@@ -1100,7 +1100,7 @@ void ScDPObject::UpdateReference( UpdateRefMode eUpdateRefMode,
|
||||
nRow2 = rSrcRange.aEnd.Row();
|
||||
nTab2 = rSrcRange.aEnd.Tab();
|
||||
|
||||
eRes = ScRefUpdate::Update(mpDocument, eUpdateRefMode,
|
||||
eRes = ScRefUpdate::Update(*mpDocument, eUpdateRefMode,
|
||||
rRange.aStart.Col(), rRange.aStart.Row(), rRange.aStart.Tab(),
|
||||
rRange.aEnd.Col(), rRange.aEnd.Row(), rRange.aEnd.Tab(), nDx, nDy, nDz,
|
||||
nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
|
||||
@@ -3077,7 +3077,7 @@ void ScDPCollection::SheetCaches::updateReference(
|
||||
SCTAB nTab2 = rKeyRange.aEnd.Tab();
|
||||
|
||||
ScRefUpdateRes eRes = ScRefUpdate::Update(
|
||||
&mrDoc, eMode,
|
||||
mrDoc, eMode,
|
||||
r.aStart.Col(), r.aStart.Row(), r.aStart.Tab(),
|
||||
r.aEnd.Col(), r.aEnd.Row(), r.aEnd.Tab(), nDx, nDy, nDz,
|
||||
nCol1, nRow1, nTab1, nCol2, nRow2, nTab2);
|
||||
|
||||
@@ -1923,7 +1923,7 @@ void ScTable::UpdateReference(
|
||||
nERow = rPrintRange.aEnd.Row();
|
||||
|
||||
// do not try to modify sheet index of print range
|
||||
if ( ScRefUpdate::Update( &rDocument, eUpdateRefMode,
|
||||
if ( ScRefUpdate::Update( rDocument, eUpdateRefMode,
|
||||
nCol1,nRow1,nTab, nCol2,nRow2,nTab,
|
||||
nDx,nDy,0,
|
||||
nSCol,nSRow,nSTab, nECol,nERow,nETab ) )
|
||||
@@ -1941,7 +1941,7 @@ void ScTable::UpdateReference(
|
||||
nERow = moRepeatColRange->aEnd.Row();
|
||||
|
||||
// do not try to modify sheet index of repeat range
|
||||
if ( ScRefUpdate::Update( &rDocument, eUpdateRefMode,
|
||||
if ( ScRefUpdate::Update( rDocument, eUpdateRefMode,
|
||||
nCol1,nRow1,nTab, nCol2,nRow2,nTab,
|
||||
nDx,nDy,0,
|
||||
nSCol,nSRow,nSTab, nECol,nERow,nETab ) )
|
||||
@@ -1961,7 +1961,7 @@ void ScTable::UpdateReference(
|
||||
nERow = moRepeatRowRange->aEnd.Row();
|
||||
|
||||
// do not try to modify sheet index of repeat range
|
||||
if ( ScRefUpdate::Update( &rDocument, eUpdateRefMode,
|
||||
if ( ScRefUpdate::Update( rDocument, eUpdateRefMode,
|
||||
nCol1,nRow1,nTab, nCol2,nRow2,nTab,
|
||||
nDx,nDy,0,
|
||||
nSCol,nSRow,nSTab, nECol,nERow,nETab ) )
|
||||
|
||||
@@ -435,7 +435,7 @@ bool ScTableProtectionImpl::updateReference( UpdateRefMode eMode, const ScDocume
|
||||
for (auto& rEnhancedProtection : maEnhancedProtection)
|
||||
{
|
||||
if (rEnhancedProtection.maRangeList.is())
|
||||
bChanged |= rEnhancedProtection.maRangeList->UpdateReference( eMode, &rDoc, rWhere, nDx, nDy, nDz);
|
||||
bChanged |= rEnhancedProtection.maRangeList->UpdateReference( eMode, rDoc, rWhere, nDx, nDy, nDz);
|
||||
}
|
||||
return bChanged;
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ ScValidationData::~ScValidationData()
|
||||
|
||||
bool ScValidationData::IsEmpty() const
|
||||
{
|
||||
ScValidationData aDefault( SC_VALID_ANY, ScConditionMode::Equal, u""_ustr, u""_ustr, *GetDocument(), ScAddress() );
|
||||
ScValidationData aDefault( SC_VALID_ANY, ScConditionMode::Equal, u""_ustr, u""_ustr, GetDocument(), ScAddress() );
|
||||
return EqualEntries( aDefault );
|
||||
}
|
||||
|
||||
@@ -185,8 +185,8 @@ bool ScValidationData::GetErrMsg( OUString& rTitle, OUString& rMsg,
|
||||
bool ScValidationData::DoScript( const ScAddress& rPos, const OUString& rInput,
|
||||
ScFormulaCell* pCell, weld::Window* pParent ) const
|
||||
{
|
||||
ScDocument* pDocument = GetDocument();
|
||||
ScDocShell* pDocSh = pDocument->GetDocumentShell();
|
||||
ScDocument& rDocument = GetDocument();
|
||||
ScDocShell* pDocSh = rDocument.GetDocumentShell();
|
||||
if ( !pDocSh )
|
||||
return false;
|
||||
|
||||
@@ -203,19 +203,19 @@ bool ScValidationData::DoScript( const ScAddress& rPos, const OUString& rInput,
|
||||
}
|
||||
|
||||
// 2) Position of the cell
|
||||
OUString aPosStr(rPos.Format(ScRefFlags::VALID | ScRefFlags::TAB_3D, pDocument, pDocument->GetAddressConvention()));
|
||||
OUString aPosStr(rPos.Format(ScRefFlags::VALID | ScRefFlags::TAB_3D, &rDocument, rDocument.GetAddressConvention()));
|
||||
|
||||
// Set up parameters
|
||||
css::uno::Sequence< css::uno::Any > aParams{ aParam0, css::uno::Any(aPosStr) };
|
||||
|
||||
// use link-update flag to prevent closing the document
|
||||
// while the macro is running
|
||||
bool bWasInLinkUpdate = pDocument->IsInLinkUpdate();
|
||||
bool bWasInLinkUpdate = rDocument.IsInLinkUpdate();
|
||||
if ( !bWasInLinkUpdate )
|
||||
pDocument->SetInLinkUpdate( true );
|
||||
rDocument.SetInLinkUpdate( true );
|
||||
|
||||
if ( pCell )
|
||||
pDocument->LockTable( rPos.Tab() );
|
||||
rDocument.LockTable( rPos.Tab() );
|
||||
|
||||
css::uno::Any aRet;
|
||||
css::uno::Sequence< sal_Int16 > aOutArgsIndex;
|
||||
@@ -225,10 +225,10 @@ bool ScValidationData::DoScript( const ScAddress& rPos, const OUString& rInput,
|
||||
aErrorTitle, aParams, aRet, aOutArgsIndex, aOutArgs );
|
||||
|
||||
if ( pCell )
|
||||
pDocument->UnlockTable( rPos.Tab() );
|
||||
rDocument.UnlockTable( rPos.Tab() );
|
||||
|
||||
if ( !bWasInLinkUpdate )
|
||||
pDocument->SetInLinkUpdate( false );
|
||||
rDocument.SetInLinkUpdate( false );
|
||||
|
||||
// Check the return value from the script
|
||||
// The contents of the cell get reset if the script returns false
|
||||
@@ -264,8 +264,8 @@ bool ScValidationData::DoMacro( const ScAddress& rPos, const OUString& rInput,
|
||||
return DoScript( rPos, rInput, pCell, pParent );
|
||||
}
|
||||
|
||||
ScDocument* pDocument = GetDocument();
|
||||
ScDocShell* pDocSh = pDocument->GetDocumentShell();
|
||||
ScDocument& rDocument = GetDocument();
|
||||
ScDocShell* pDocSh = rDocument.GetDocumentShell();
|
||||
if ( !pDocSh )
|
||||
return false;
|
||||
|
||||
@@ -323,24 +323,24 @@ bool ScValidationData::DoMacro( const ScAddress& rPos, const OUString& rInput,
|
||||
refPar->Get(1)->PutString(aValStr);
|
||||
|
||||
// 2) Position of the cell
|
||||
OUString aPosStr(rPos.Format(ScRefFlags::VALID | ScRefFlags::TAB_3D, pDocument, pDocument->GetAddressConvention()));
|
||||
OUString aPosStr(rPos.Format(ScRefFlags::VALID | ScRefFlags::TAB_3D, &rDocument, rDocument.GetAddressConvention()));
|
||||
refPar->Get(2)->PutString(aPosStr);
|
||||
|
||||
// use link-update flag to prevent closing the document
|
||||
// while the macro is running
|
||||
bool bWasInLinkUpdate = pDocument->IsInLinkUpdate();
|
||||
bool bWasInLinkUpdate = rDocument.IsInLinkUpdate();
|
||||
if ( !bWasInLinkUpdate )
|
||||
pDocument->SetInLinkUpdate( true );
|
||||
rDocument.SetInLinkUpdate( true );
|
||||
|
||||
if ( pCell )
|
||||
pDocument->LockTable( rPos.Tab() );
|
||||
rDocument.LockTable( rPos.Tab() );
|
||||
SbxVariableRef refRes = new SbxVariable;
|
||||
ErrCode eRet = pDocSh->CallBasic( aMacroStr, aBasicStr, refPar.get(), refRes.get() );
|
||||
if ( pCell )
|
||||
pDocument->UnlockTable( rPos.Tab() );
|
||||
rDocument.UnlockTable( rPos.Tab() );
|
||||
|
||||
if ( !bWasInLinkUpdate )
|
||||
pDocument->SetInLinkUpdate( false );
|
||||
rDocument.SetInLinkUpdate( false );
|
||||
|
||||
// Interrupt input if Basic macro returns false
|
||||
if ( eRet == ERRCODE_NONE && refRes->GetType() == SbxBOOL && !refRes->GetBool() )
|
||||
@@ -459,7 +459,7 @@ bool ScValidationData::IsDataValidCustom(
|
||||
}
|
||||
else
|
||||
{
|
||||
pFormatter = GetDocument()->GetFormatTable();
|
||||
pFormatter = GetDocument().GetFormatTable();
|
||||
|
||||
// get the value if any
|
||||
nFormat = rPattern.GetNumberFormat(pFormatter);
|
||||
@@ -475,15 +475,15 @@ bool ScValidationData::IsDataValidCustom(
|
||||
}
|
||||
else
|
||||
{
|
||||
aSS = mpDoc->GetSharedStringPool().intern(rStrResult);
|
||||
aSS = mrDoc.GetSharedStringPool().intern(rStrResult);
|
||||
aTmpCell = ScRefCellValue(&aSS);
|
||||
}
|
||||
|
||||
ScCellValue aOriginalCellValue(ScRefCellValue(*GetDocument(), rPos));
|
||||
ScCellValue aOriginalCellValue(ScRefCellValue(GetDocument(), rPos));
|
||||
|
||||
aTmpCell.commit(*GetDocument(), rPos);
|
||||
aTmpCell.commit(GetDocument(), rPos);
|
||||
bool bRet = IsCellValid(aTmpCell, rPos);
|
||||
aOriginalCellValue.commit(*GetDocument(), rPos);
|
||||
aOriginalCellValue.commit(GetDocument(), rPos);
|
||||
|
||||
return bRet;
|
||||
}
|
||||
@@ -521,7 +521,7 @@ bool ScValidationData::IsDataValidTextLen( std::u16string_view rTest, const ScAd
|
||||
else
|
||||
{
|
||||
if (!pDataNumeric->mpFormatter)
|
||||
pDataNumeric->init( *GetDocument(), rPos);
|
||||
pDataNumeric->init( GetDocument(), rPos);
|
||||
|
||||
// For numeric values use the resulting input line string to
|
||||
// determine length, otherwise an once accepted value maybe could
|
||||
@@ -560,7 +560,7 @@ bool ScValidationData::IsDataValid(
|
||||
}
|
||||
else
|
||||
{
|
||||
pFormatter = GetDocument()->GetFormatTable();
|
||||
pFormatter = GetDocument().GetFormatTable();
|
||||
|
||||
// get the value if any
|
||||
nFormat = rPattern.GetNumberFormat(pFormatter);
|
||||
@@ -588,7 +588,7 @@ bool ScValidationData::IsDataValid(
|
||||
}
|
||||
else
|
||||
{
|
||||
svl::SharedString aSS = mpDoc->GetSharedStringPool().intern( rStrResult );
|
||||
svl::SharedString aSS = mrDoc.GetSharedStringPool().intern( rStrResult );
|
||||
ScRefCellValue aTmpCell(&aSS);
|
||||
bRet = IsDataValid(aTmpCell, rPos);
|
||||
}
|
||||
@@ -620,7 +620,7 @@ bool ScValidationData::IsDataValid( const ScRefCellValue& rCell, const ScAddress
|
||||
break;
|
||||
case CELLTYPE_EDIT:
|
||||
if (rCell.getEditText())
|
||||
aString = ScEditUtil::GetString(*rCell.getEditText(), GetDocument());
|
||||
aString = ScEditUtil::GetString(*rCell.getEditText(), &GetDocument());
|
||||
bIsVal = false;
|
||||
break;
|
||||
case CELLTYPE_FORMULA:
|
||||
@@ -674,7 +674,7 @@ bool ScValidationData::IsDataValid( const ScRefCellValue& rCell, const ScAddress
|
||||
bool ScValidationData::isFormulaResultsValidatable(const OUString& rTest, const ScAddress& rPos, SvNumberFormatter* pFormatter,
|
||||
OUString& rStrResult, double& nVal, sal_uInt32& nFormat, bool& bIsVal) const
|
||||
{
|
||||
std::optional<ScSimpleFormulaCalculator> pFCell(std::in_place, *mpDoc, rPos, rTest, true);
|
||||
std::optional<ScSimpleFormulaCalculator> pFCell(std::in_place, mrDoc, rPos, rTest, true);
|
||||
pFCell->SetLimitString(true);
|
||||
|
||||
bool bColRowName = pFCell->HasColRowName();
|
||||
@@ -685,7 +685,7 @@ bool ScValidationData::isFormulaResultsValidatable(const OUString& rTest, const
|
||||
{ // ==1: area
|
||||
// ==0: would be an area if...
|
||||
OUString aBraced = "(" + rTest + ")";
|
||||
pFCell.emplace(*mpDoc, rPos, aBraced, true);
|
||||
pFCell.emplace(mrDoc, rPos, aBraced, true);
|
||||
pFCell->SetLimitString(true);
|
||||
}
|
||||
else
|
||||
@@ -695,7 +695,7 @@ bool ScValidationData::isFormulaResultsValidatable(const OUString& rTest, const
|
||||
FormulaError nErrCode = pFCell->GetErrCode();
|
||||
if (nErrCode == FormulaError::NONE || pFCell->IsMatrix())
|
||||
{
|
||||
pFormatter = mpDoc->GetFormatTable();
|
||||
pFormatter = mrDoc.GetFormatTable();
|
||||
const Color* pColor;
|
||||
if (pFCell->IsMatrix())
|
||||
{
|
||||
@@ -723,7 +723,7 @@ bool ScValidationData::isFormulaResultsValidatable(const OUString& rTest, const
|
||||
}
|
||||
|
||||
ScRange aTestRange;
|
||||
if (bColRowName || (aTestRange.Parse(rTest, *mpDoc) & ScRefFlags::VALID))
|
||||
if (bColRowName || (aTestRange.Parse(rTest, mrDoc) & ScRefFlags::VALID))
|
||||
rStrResult += " ...";
|
||||
// area
|
||||
|
||||
@@ -810,12 +810,10 @@ bool ScValidationData::GetSelectionFromFormula(
|
||||
bool bOk = true;
|
||||
|
||||
// pDoc is private in condition, use an accessor and a long winded name.
|
||||
ScDocument* pDocument = GetDocument();
|
||||
if( nullptr == pDocument )
|
||||
return false;
|
||||
ScDocument& rDocument = GetDocument();
|
||||
|
||||
ScFormulaCell aValidationSrc(
|
||||
*pDocument, rPos, rTokArr, formula::FormulaGrammar::GRAM_DEFAULT, ScMatrixMode::Formula);
|
||||
rDocument, rPos, rTokArr, formula::FormulaGrammar::GRAM_DEFAULT, ScMatrixMode::Formula);
|
||||
|
||||
// Make sure the formula gets interpreted and a result is delivered,
|
||||
// regardless of the AutoCalc setting.
|
||||
@@ -857,8 +855,8 @@ bool ScValidationData::GetSelectionFromFormula(
|
||||
// which index matched. We will want it eventually to pre-select that item.
|
||||
rMatch = -1;
|
||||
|
||||
SvNumberFormatter* pFormatter = GetDocument()->GetFormatTable();
|
||||
sal_uInt32 nDestFormat = pDocument->GetNumberFormat(rPos.Col(), rPos.Row(), rPos.Tab());
|
||||
SvNumberFormatter* pFormatter = rDocument.GetFormatTable();
|
||||
sal_uInt32 nDestFormat = rDocument.GetNumberFormat(rPos.Col(), rPos.Row(), rPos.Tab());
|
||||
|
||||
SCSIZE nCol, nRow, nCols, nRows, n = 0;
|
||||
pValues->GetDimensions( nCols, nRows );
|
||||
@@ -876,7 +874,7 @@ bool ScValidationData::GetSelectionFromFormula(
|
||||
OpCode eOpCode = t->GetOpCode();
|
||||
if (eOpCode == ocDBArea || eOpCode == ocTableRef)
|
||||
{
|
||||
if (const ScDBData* pDBData = pDocument->GetDBCollection()->getNamedDBs().findByIndex(t->GetIndex()))
|
||||
if (const ScDBData* pDBData = rDocument.GetDBCollection()->getNamedDBs().findByIndex(t->GetIndex()))
|
||||
{
|
||||
pDBData->GetArea(aRange);
|
||||
bRef = true;
|
||||
@@ -884,7 +882,7 @@ bool ScValidationData::GetSelectionFromFormula(
|
||||
}
|
||||
else if (eOpCode == ocName)
|
||||
{
|
||||
const ScRangeData* pName = pDocument->FindRangeNameBySheetAndIndex( t->GetSheet(), t->GetIndex());
|
||||
const ScRangeData* pName = rDocument.FindRangeNameBySheetAndIndex( t->GetSheet(), t->GetIndex());
|
||||
if (pName && pName->IsReference(aRange))
|
||||
{
|
||||
bRef = true;
|
||||
@@ -901,7 +899,7 @@ bool ScValidationData::GetSelectionFromFormula(
|
||||
}
|
||||
|
||||
bool bHaveEmpty = false;
|
||||
svl::SharedStringPool& rSPool = pDocument->GetSharedStringPool();
|
||||
svl::SharedStringPool& rSPool = rDocument.GetSharedStringPool();
|
||||
|
||||
/* XL artificially limits things to a single col or row in the UI but does
|
||||
* not list the constraint in MOOXml. If a defined name or INDIRECT
|
||||
@@ -913,7 +911,7 @@ bool ScValidationData::GetSelectionFromFormula(
|
||||
{
|
||||
for( nCol = 0; nCol < nCols ; nCol++ )
|
||||
{
|
||||
ScTokenArray aCondTokArr(*pDocument);
|
||||
ScTokenArray aCondTokArr(rDocument);
|
||||
std::unique_ptr<ScTypedStrData> pEntry;
|
||||
OUString aValStr;
|
||||
ScMatrixValue nMatVal = pValues->Get( nCol, nRow);
|
||||
@@ -955,7 +953,7 @@ bool ScValidationData::GetSelectionFromFormula(
|
||||
//For external reference and a formula that results in an area or array, date formats are still lost.
|
||||
if ( bRef )
|
||||
{
|
||||
aValStr = pDocument->GetInputString(static_cast<SCCOL>(nCol+aRange.aStart.Col()),
|
||||
aValStr = rDocument.GetInputString(static_cast<SCCOL>(nCol+aRange.aStart.Col()),
|
||||
static_cast<SCROW>(nRow+aRange.aStart.Row()), aRange.aStart.Tab());
|
||||
}
|
||||
else
|
||||
@@ -1006,13 +1004,13 @@ bool ScValidationData::FillSelectionList(std::vector<ScTypedStrData>& rStrColl,
|
||||
|
||||
// *** try if formula is a string list ***
|
||||
|
||||
sal_uInt32 nFormat = lclGetCellFormat( *GetDocument(), rPos );
|
||||
sal_uInt32 nFormat = lclGetCellFormat( GetDocument(), rPos );
|
||||
ScStringTokenIterator aIt( *pTokArr );
|
||||
for (rtl_uString* pString = aIt.First(); pString && aIt.Ok(); pString = aIt.Next())
|
||||
{
|
||||
double fValue;
|
||||
OUString aStr(pString);
|
||||
bool bIsValue = GetDocument()->GetFormatTable()->IsNumberFormat(aStr, nFormat, fValue);
|
||||
bool bIsValue = GetDocument().GetFormatTable()->IsNumberFormat(aStr, nFormat, fValue);
|
||||
rStrColl.emplace_back(
|
||||
aStr, fValue, fValue, bIsValue ? ScTypedStrData::Value : ScTypedStrData::Standard);
|
||||
}
|
||||
@@ -1035,7 +1033,7 @@ bool ScValidationData::FillSelectionList(std::vector<ScTypedStrData>& rStrColl,
|
||||
bool ScValidationData::IsEqualToTokenArray( const ScRefCellValue& rCell, const ScAddress& rPos, const ScTokenArray& rTokArr ) const
|
||||
{
|
||||
// create a condition entry that tests on equality and set the passed token array
|
||||
ScConditionEntry aCondEntry( ScConditionMode::Equal, &rTokArr, nullptr, *GetDocument(), rPos );
|
||||
ScConditionEntry aCondEntry( ScConditionMode::Equal, &rTokArr, nullptr, GetDocument(), rPos );
|
||||
aCondEntry.SetCaseSensitive(IsCaseSensitive());
|
||||
|
||||
return aCondEntry.IsCellValid(rCell, rPos);
|
||||
@@ -1060,8 +1058,8 @@ bool ScValidationData::IsListValid( const ScRefCellValue& rCell, const ScAddress
|
||||
|
||||
// *** try if formula is a string list ***
|
||||
|
||||
svl::SharedStringPool& rSPool = GetDocument()->GetSharedStringPool();
|
||||
sal_uInt32 nFormat = lclGetCellFormat( *GetDocument(), rPos );
|
||||
svl::SharedStringPool& rSPool = GetDocument().GetSharedStringPool();
|
||||
sal_uInt32 nFormat = lclGetCellFormat( GetDocument(), rPos );
|
||||
ScStringTokenIterator aIt( *pTokArr );
|
||||
for (rtl_uString* pString = aIt.First(); pString && aIt.Ok(); pString = aIt.Next())
|
||||
{
|
||||
@@ -1070,10 +1068,10 @@ bool ScValidationData::IsListValid( const ScRefCellValue& rCell, const ScAddress
|
||||
if( !bIsValid )
|
||||
{
|
||||
// create a formula containing a single string or number
|
||||
ScTokenArray aCondTokArr(*GetDocument());
|
||||
ScTokenArray aCondTokArr(GetDocument());
|
||||
double fValue;
|
||||
OUString aStr(pString);
|
||||
if (GetDocument()->GetFormatTable()->IsNumberFormat(aStr, nFormat, fValue))
|
||||
if (GetDocument().GetFormatTable()->IsNumberFormat(aStr, nFormat, fValue))
|
||||
aCondTokArr.AddDouble( fValue );
|
||||
else
|
||||
aCondTokArr.AddString(rSPool.intern(aStr));
|
||||
@@ -1117,7 +1115,7 @@ ScValidationDataList::ScValidationDataList(ScDocument& rNewDoc,
|
||||
|
||||
for (const auto& rxItem : rList)
|
||||
{
|
||||
InsertNew( std::unique_ptr<ScValidationData>(rxItem->Clone(&rNewDoc)) );
|
||||
InsertNew( std::unique_ptr<ScValidationData>(rxItem->Clone(rNewDoc)) );
|
||||
}
|
||||
|
||||
//TODO: faster insert for sorted entries from rList ???
|
||||
|
||||
@@ -148,7 +148,7 @@ class ScBroadcastAreaSlot
|
||||
private:
|
||||
ScBroadcastAreas aBroadcastAreaTbl;
|
||||
mutable ScBroadcastArea aTmpSeekBroadcastArea; // for FindBroadcastArea()
|
||||
ScDocument* pDoc;
|
||||
ScDocument& rDoc;
|
||||
ScBroadcastAreaSlotMachine* pBASM;
|
||||
bool mbInBroadcastIteration;
|
||||
|
||||
@@ -182,7 +182,7 @@ private:
|
||||
}
|
||||
|
||||
public:
|
||||
ScBroadcastAreaSlot( ScDocument* pDoc,
|
||||
ScBroadcastAreaSlot( ScDocument& rDoc,
|
||||
ScBroadcastAreaSlotMachine* pBASM );
|
||||
~ScBroadcastAreaSlot();
|
||||
|
||||
@@ -313,7 +313,7 @@ private:
|
||||
TableSlotsMap aTableSlotsMap;
|
||||
AreasToBeErased maAreasToBeErased;
|
||||
std::unique_ptr<SvtBroadcaster> pBCAlways; // for the RC_ALWAYS special range
|
||||
ScDocument *pDoc;
|
||||
ScDocument &rDoc;
|
||||
ScBroadcastArea *pUpdateChain;
|
||||
ScBroadcastArea *pEOUpdateChain;
|
||||
sal_uInt32 nInBulkBroadcast;
|
||||
@@ -327,7 +327,7 @@ private:
|
||||
#endif
|
||||
|
||||
public:
|
||||
ScBroadcastAreaSlotMachine( ScDocument* pDoc );
|
||||
ScBroadcastAreaSlotMachine( ScDocument& rDoc );
|
||||
~ScBroadcastAreaSlotMachine();
|
||||
void StartListeningArea(
|
||||
const ScRange& rRange, bool bGroupListening, SvtListener* pListener );
|
||||
|
||||
@@ -43,7 +43,7 @@ class ScRefUpdate
|
||||
public:
|
||||
|
||||
static ScRefUpdateRes Update
|
||||
( const ScDocument* pDoc, UpdateRefMode eUpdateRefMode,
|
||||
( const ScDocument& rDoc, UpdateRefMode eUpdateRefMode,
|
||||
SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
|
||||
SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
|
||||
SCCOL nDx, SCROW nDy, SCTAB nDz,
|
||||
|
||||
@@ -578,7 +578,7 @@ void ScDBData::UpdateMoveTab(SCTAB nOldPos, SCTAB nNewPos)
|
||||
SetModified(bChanged);
|
||||
}
|
||||
|
||||
bool ScDBData::UpdateReference(const ScDocument* pDoc, UpdateRefMode eUpdateRefMode,
|
||||
bool ScDBData::UpdateReference(const ScDocument& rDoc, UpdateRefMode eUpdateRefMode,
|
||||
SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
|
||||
SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
|
||||
SCCOL nDx, SCROW nDy, SCTAB nDz)
|
||||
@@ -594,7 +594,7 @@ bool ScDBData::UpdateReference(const ScDocument* pDoc, UpdateRefMode eUpdateRefM
|
||||
SCCOL nOldCol1 = theCol1, nOldCol2 = theCol2;
|
||||
|
||||
ScRefUpdateRes eRet
|
||||
= ScRefUpdate::Update(pDoc, eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, nDx,
|
||||
= ScRefUpdate::Update(rDoc, eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, nDx,
|
||||
nDy, nDz, theCol1, theRow1, theTab1, theCol2, theRow2, theTab2);
|
||||
|
||||
bool bDoUpdate = eRet != UR_NOTHING;
|
||||
@@ -621,7 +621,7 @@ bool ScDBData::UpdateReference(const ScDocument* pDoc, UpdateRefMode eUpdateRefM
|
||||
if ( GetAdvancedQuerySource(aRangeAdvSource) )
|
||||
{
|
||||
aRangeAdvSource.GetVars( theCol1,theRow1,theTab1, theCol2,theRow2,theTab2 );
|
||||
if ( ScRefUpdate::Update( pDoc, eUpdateRefMode,
|
||||
if ( ScRefUpdate::Update( rDoc, eUpdateRefMode,
|
||||
nCol1,nRow1,nTab1, nCol2,nRow2,nTab2, nDx,nDy,nDz,
|
||||
theCol1,theRow1,theTab1, theCol2,theRow2,theTab2 ) )
|
||||
{
|
||||
@@ -1543,7 +1543,7 @@ void ScDBCollection::UpdateReference(UpdateRefMode eUpdateRefMode,
|
||||
if (nTab1 == nTab2 && nDz == 0)
|
||||
{
|
||||
// Delete the database range, if some part of the reference became invalid.
|
||||
if (pData->UpdateReference(&rDoc, eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2,
|
||||
if (pData->UpdateReference(rDoc, eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2,
|
||||
nTab2, nDx, nDy, nDz))
|
||||
rDoc.SetAnonymousDBData(nTab1, nullptr);
|
||||
}
|
||||
@@ -1556,7 +1556,7 @@ void ScDBCollection::UpdateReference(UpdateRefMode eUpdateRefMode,
|
||||
for (auto it = maNamedDBs.begin(); it != maNamedDBs.end(); )
|
||||
{
|
||||
// Delete the database range, if some part of the reference became invalid.
|
||||
if (it->get()->UpdateReference(&rDoc, eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2,
|
||||
if (it->get()->UpdateReference(rDoc, eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2,
|
||||
nTab2, nDx, nDy, nDz))
|
||||
it = maNamedDBs.erase(it);
|
||||
else
|
||||
@@ -1565,7 +1565,7 @@ void ScDBCollection::UpdateReference(UpdateRefMode eUpdateRefMode,
|
||||
for (auto it = maAnonDBs.begin(); it != maAnonDBs.end(); )
|
||||
{
|
||||
// Delete the database range, if some part of the reference became invalid.
|
||||
if (it->get()->UpdateReference(&rDoc, eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2,
|
||||
if (it->get()->UpdateReference(rDoc, eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2,
|
||||
nTab2, nDx, nDy, nDz))
|
||||
it = maAnonDBs.erase(it);
|
||||
else
|
||||
|
||||
@@ -35,7 +35,7 @@ void ScDetOpList::DeleteOnTab( SCTAB nTab )
|
||||
});
|
||||
}
|
||||
|
||||
void ScDetOpList::UpdateReference( const ScDocument* pDoc, UpdateRefMode eUpdateRefMode,
|
||||
void ScDetOpList::UpdateReference( const ScDocument& rDoc, UpdateRefMode eUpdateRefMode,
|
||||
const ScRange& rRange, SCCOL nDx, SCROW nDy, SCTAB nDz )
|
||||
{
|
||||
for (auto& rxDetOpData : aDetOpDataVector )
|
||||
@@ -49,7 +49,7 @@ void ScDetOpList::UpdateReference( const ScDocument* pDoc, UpdateRefMode eUpdate
|
||||
SCTAB nTab2 = nTab1;
|
||||
|
||||
ScRefUpdateRes eRes =
|
||||
ScRefUpdate::Update( pDoc, eUpdateRefMode,
|
||||
ScRefUpdate::Update( rDoc, eUpdateRefMode,
|
||||
rRange.aStart.Col(), rRange.aStart.Row(), rRange.aStart.Tab(),
|
||||
rRange.aEnd.Col(), rRange.aEnd.Row(), rRange.aEnd.Tab(), nDx, nDy, nDz,
|
||||
nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
|
||||
|
||||
@@ -356,7 +356,7 @@ bool ScRangeList::operator!=( const ScRangeList& r ) const
|
||||
|
||||
bool ScRangeList::UpdateReference(
|
||||
UpdateRefMode eUpdateRefMode,
|
||||
const ScDocument* pDoc,
|
||||
const ScDocument& rDoc,
|
||||
const ScRange& rWhere,
|
||||
SCCOL nDx,
|
||||
SCROW nDy,
|
||||
@@ -405,7 +405,7 @@ bool ScRangeList::UpdateReference(
|
||||
SCROW theRow2;
|
||||
SCTAB theTab2;
|
||||
rR.GetVars( theCol1, theRow1, theTab1, theCol2, theRow2, theTab2 );
|
||||
if ( ScRefUpdate::Update( pDoc, eUpdateRefMode,
|
||||
if ( ScRefUpdate::Update( rDoc, eUpdateRefMode,
|
||||
nCol1, nRow1, nTab1, nCol2, nRow2, nTab2,
|
||||
nDx, nDy, nDz,
|
||||
theCol1, theRow1, theTab1, theCol2, theRow2, theTab2 )
|
||||
@@ -1227,7 +1227,7 @@ size_t ScRangePairList::size() const
|
||||
}
|
||||
|
||||
void ScRangePairList::UpdateReference( UpdateRefMode eUpdateRefMode,
|
||||
const ScDocument* pDoc, const ScRange& rWhere,
|
||||
const ScDocument& rDoc, const ScRange& rWhere,
|
||||
SCCOL nDx, SCROW nDy, SCTAB nDz )
|
||||
{
|
||||
if ( maPairs.empty() )
|
||||
@@ -1252,7 +1252,7 @@ void ScRangePairList::UpdateReference( UpdateRefMode eUpdateRefMode,
|
||||
SCROW theRow2;
|
||||
SCTAB theTab2;
|
||||
rRange.GetVars( theCol1, theRow1, theTab1, theCol2, theRow2, theTab2 );
|
||||
if ( ScRefUpdate::Update( pDoc, eUpdateRefMode,
|
||||
if ( ScRefUpdate::Update( rDoc, eUpdateRefMode,
|
||||
nCol1, nRow1, nTab1, nCol2, nRow2, nTab2,
|
||||
nDx, nDy, nDz,
|
||||
theCol1, theRow1, theTab1, theCol2, theRow2, theTab2 )
|
||||
|
||||
@@ -184,7 +184,7 @@ static bool lcl_MoveItCutBig( sal_Int64& rRef, sal_Int32 nDelta )
|
||||
return bCut;
|
||||
}
|
||||
|
||||
ScRefUpdateRes ScRefUpdate::Update( const ScDocument* pDoc, UpdateRefMode eUpdateRefMode,
|
||||
ScRefUpdateRes ScRefUpdate::Update( const ScDocument& rDoc, UpdateRefMode eUpdateRefMode,
|
||||
SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
|
||||
SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
|
||||
SCCOL nDx, SCROW nDy, SCTAB nDz,
|
||||
@@ -204,13 +204,13 @@ ScRefUpdateRes ScRefUpdate::Update( const ScDocument* pDoc, UpdateRefMode eUpdat
|
||||
|
||||
if (eUpdateRefMode == URM_INSDEL)
|
||||
{
|
||||
bool bExpand = pDoc->IsExpandRefs();
|
||||
bool bExpand = rDoc.IsExpandRefs();
|
||||
if ( nDx && (theRow1 >= nRow1) && (theRow2 <= nRow2) &&
|
||||
(theTab1 >= nTab1) && (theTab2 <= nTab2))
|
||||
{
|
||||
bool bExp = (bExpand && IsExpand( theCol1, theCol2, nCol1, nDx ));
|
||||
bCut1 = lcl_MoveStart( theCol1, nCol1, nDx, pDoc->MaxCol() );
|
||||
bCut2 = lcl_MoveEnd( theCol2, nCol1, nDx, pDoc->MaxCol() );
|
||||
bCut1 = lcl_MoveStart( theCol1, nCol1, nDx, rDoc.MaxCol() );
|
||||
bCut2 = lcl_MoveEnd( theCol2, nCol1, nDx, rDoc.MaxCol() );
|
||||
if ( theCol2 < theCol1 )
|
||||
{
|
||||
eRet = UR_INVALID;
|
||||
@@ -225,28 +225,28 @@ ScRefUpdateRes ScRefUpdate::Update( const ScDocument* pDoc, UpdateRefMode eUpdat
|
||||
Expand( theCol1, theCol2, nCol1, nDx );
|
||||
eRet = UR_UPDATED;
|
||||
}
|
||||
if (eRet != UR_NOTHING && oldCol1 == 0 && oldCol2 == pDoc->MaxCol())
|
||||
if (eRet != UR_NOTHING && oldCol1 == 0 && oldCol2 == rDoc.MaxCol())
|
||||
{
|
||||
eRet = UR_STICKY;
|
||||
theCol1 = oldCol1;
|
||||
theCol2 = oldCol2;
|
||||
}
|
||||
else if (oldCol2 == pDoc->MaxCol() && oldCol1 < pDoc->MaxCol())
|
||||
else if (oldCol2 == rDoc.MaxCol() && oldCol1 < rDoc.MaxCol())
|
||||
{
|
||||
// End was sticky, but start may have been moved. Only on range.
|
||||
theCol2 = oldCol2;
|
||||
if (eRet == UR_NOTHING)
|
||||
eRet = UR_STICKY;
|
||||
}
|
||||
// Else, if (bCut2 && theCol2 == pDoc->MaxCol()) then end becomes sticky,
|
||||
// Else, if (bCut2 && theCol2 == rDoc.MaxCol()) then end becomes sticky,
|
||||
// but currently there's nothing to do.
|
||||
}
|
||||
if ( nDy && (theCol1 >= nCol1) && (theCol2 <= nCol2) &&
|
||||
(theTab1 >= nTab1) && (theTab2 <= nTab2))
|
||||
{
|
||||
bool bExp = (bExpand && IsExpand( theRow1, theRow2, nRow1, nDy ));
|
||||
bCut1 = lcl_MoveStart( theRow1, nRow1, nDy, pDoc->MaxRow() );
|
||||
bCut2 = lcl_MoveEnd( theRow2, nRow1, nDy, pDoc->MaxRow() );
|
||||
bCut1 = lcl_MoveStart( theRow1, nRow1, nDy, rDoc.MaxRow() );
|
||||
bCut2 = lcl_MoveEnd( theRow2, nRow1, nDy, rDoc.MaxRow() );
|
||||
if ( theRow2 < theRow1 )
|
||||
{
|
||||
eRet = UR_INVALID;
|
||||
@@ -261,26 +261,26 @@ ScRefUpdateRes ScRefUpdate::Update( const ScDocument* pDoc, UpdateRefMode eUpdat
|
||||
Expand( theRow1, theRow2, nRow1, nDy );
|
||||
eRet = UR_UPDATED;
|
||||
}
|
||||
if (eRet != UR_NOTHING && oldRow1 == 0 && oldRow2 == pDoc->MaxRow())
|
||||
if (eRet != UR_NOTHING && oldRow1 == 0 && oldRow2 == rDoc.MaxRow())
|
||||
{
|
||||
eRet = UR_STICKY;
|
||||
theRow1 = oldRow1;
|
||||
theRow2 = oldRow2;
|
||||
}
|
||||
else if (oldRow2 == pDoc->MaxRow() && oldRow1 < pDoc->MaxRow())
|
||||
else if (oldRow2 == rDoc.MaxRow() && oldRow1 < rDoc.MaxRow())
|
||||
{
|
||||
// End was sticky, but start may have been moved. Only on range.
|
||||
theRow2 = oldRow2;
|
||||
if (eRet == UR_NOTHING)
|
||||
eRet = UR_STICKY;
|
||||
}
|
||||
// Else, if (bCut2 && theRow2 == pDoc->MaxRow()) then end becomes sticky,
|
||||
// Else, if (bCut2 && theRow2 == rDoc.MaxRow()) then end becomes sticky,
|
||||
// but currently there's nothing to do.
|
||||
}
|
||||
if ( nDz && (theCol1 >= nCol1) && (theCol2 <= nCol2) &&
|
||||
(theRow1 >= nRow1) && (theRow2 <= nRow2) )
|
||||
{
|
||||
SCTAB nMaxTab = pDoc->GetTableCount() - 1;
|
||||
SCTAB nMaxTab = rDoc.GetTableCount() - 1;
|
||||
nMaxTab = sal::static_int_cast<SCTAB>(nMaxTab + nDz); // adjust to new count
|
||||
bool bExp = (bExpand && IsExpand( theTab1, theTab2, nTab1, nDz ));
|
||||
bCut1 = lcl_MoveStart( theTab1, nTab1, nDz, nMaxTab, false /*bShrink*/);
|
||||
@@ -306,11 +306,11 @@ ScRefUpdateRes ScRefUpdate::Update( const ScDocument* pDoc, UpdateRefMode eUpdat
|
||||
{
|
||||
if ( nDx )
|
||||
{
|
||||
bCut1 = lcl_MoveItCut( theCol1, nDx, pDoc->MaxCol() );
|
||||
bCut2 = lcl_MoveItCut( theCol2, nDx, pDoc->MaxCol() );
|
||||
bCut1 = lcl_MoveItCut( theCol1, nDx, rDoc.MaxCol() );
|
||||
bCut2 = lcl_MoveItCut( theCol2, nDx, rDoc.MaxCol() );
|
||||
if ( bCut1 || bCut2 )
|
||||
eRet = UR_UPDATED;
|
||||
if (eRet != UR_NOTHING && oldCol1 == 0 && oldCol2 == pDoc->MaxCol())
|
||||
if (eRet != UR_NOTHING && oldCol1 == 0 && oldCol2 == rDoc.MaxCol())
|
||||
{
|
||||
eRet = UR_STICKY;
|
||||
theCol1 = oldCol1;
|
||||
@@ -319,11 +319,11 @@ ScRefUpdateRes ScRefUpdate::Update( const ScDocument* pDoc, UpdateRefMode eUpdat
|
||||
}
|
||||
if ( nDy )
|
||||
{
|
||||
bCut1 = lcl_MoveItCut( theRow1, nDy, pDoc->MaxRow() );
|
||||
bCut2 = lcl_MoveItCut( theRow2, nDy, pDoc->MaxRow() );
|
||||
bCut1 = lcl_MoveItCut( theRow1, nDy, rDoc.MaxRow() );
|
||||
bCut2 = lcl_MoveItCut( theRow2, nDy, rDoc.MaxRow() );
|
||||
if ( bCut1 || bCut2 )
|
||||
eRet = UR_UPDATED;
|
||||
if (eRet != UR_NOTHING && oldRow1 == 0 && oldRow2 == pDoc->MaxRow())
|
||||
if (eRet != UR_NOTHING && oldRow1 == 0 && oldRow2 == rDoc.MaxRow())
|
||||
{
|
||||
eRet = UR_STICKY;
|
||||
theRow1 = oldRow1;
|
||||
@@ -332,7 +332,7 @@ ScRefUpdateRes ScRefUpdate::Update( const ScDocument* pDoc, UpdateRefMode eUpdat
|
||||
}
|
||||
if ( nDz )
|
||||
{
|
||||
SCTAB nMaxTab = pDoc->GetTableCount() - 1;
|
||||
SCTAB nMaxTab = rDoc.GetTableCount() - 1;
|
||||
bCut1 = lcl_MoveItCut( theTab1, nDz, nMaxTab );
|
||||
bCut2 = lcl_MoveItCut( theTab2, nDz, nMaxTab );
|
||||
if ( bCut1 || bCut2 )
|
||||
|
||||
@@ -688,7 +688,7 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm )
|
||||
|
||||
if( !mxScCondFmt )
|
||||
{
|
||||
mxScCondFmt.reset( new ScConditionalFormat( 0/*nKey*/, &GetDoc() ) );
|
||||
mxScCondFmt.reset( new ScConditionalFormat( 0/*nKey*/, GetDoc() ) );
|
||||
if(maRanges.size() > 1)
|
||||
maRanges.Join(maRanges[0], true);
|
||||
mxScCondFmt->SetRange(maRanges);
|
||||
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
void importCfvo( const AttributeList& rAttribs );
|
||||
void importColor( const AttributeList& rAttribs );
|
||||
|
||||
void AddEntries( ScColorScaleFormat* pFormat, ScDocument* pDoc, const ScAddress& rAddr );
|
||||
void AddEntries( ScColorScaleFormat* pFormat, ScDocument& rDoc, const ScAddress& rAddr );
|
||||
|
||||
const std::vector< ColorScaleRuleModelEntry > & getModelEntries() const { return maColorScaleRuleEntries; }
|
||||
sal_uInt32 getCfvo() const { return mnCfvo; }
|
||||
@@ -117,7 +117,7 @@ public:
|
||||
void importColor( const AttributeList& rAttribs );
|
||||
void importAttribs( const AttributeList& rAttribs );
|
||||
|
||||
void SetData( ScDataBarFormat* pFormat, ScDocument* pDoc, const ScAddress& rAddr );
|
||||
void SetData( ScDataBarFormat* pFormat, ScDocument& rDoc, const ScAddress& rAddr );
|
||||
|
||||
ScDataBarFormatData* getDataBarFormatData() { return mxFormat.get(); }
|
||||
|
||||
@@ -137,7 +137,7 @@ public:
|
||||
void importFormula(const OUString& rFormula);
|
||||
void importIcon(const AttributeList& rAttribs);
|
||||
|
||||
void SetData( ScIconSetFormat* pFormat, ScDocument* pDoc, const ScAddress& rAddr );
|
||||
void SetData( ScIconSetFormat* pFormat, ScDocument& rDoc, const ScAddress& rAddr );
|
||||
|
||||
private:
|
||||
std::vector< ColorScaleRuleModelEntry > maEntries;
|
||||
|
||||
@@ -310,7 +310,7 @@ void ColorScaleRule::importColor( const AttributeList& rAttribs )
|
||||
|
||||
namespace {
|
||||
|
||||
ScColorScaleEntry* ConvertToModel( const ColorScaleRuleModelEntry& rEntry, ScDocument* pDoc, const ScAddress& rAddr )
|
||||
ScColorScaleEntry* ConvertToModel( const ColorScaleRuleModelEntry& rEntry, ScDocument& rDoc, const ScAddress& rAddr )
|
||||
{
|
||||
ScColorScaleEntry* pEntry = new ScColorScaleEntry(rEntry.mnVal, rEntry.maColor);
|
||||
|
||||
@@ -328,7 +328,7 @@ ScColorScaleEntry* ConvertToModel( const ColorScaleRuleModelEntry& rEntry, ScDoc
|
||||
if(!rEntry.maFormula.isEmpty())
|
||||
{
|
||||
pEntry->SetType(COLORSCALE_FORMULA);
|
||||
pEntry->SetFormula(rEntry.maFormula, *pDoc, rAddr, formula::FormulaGrammar::GRAM_ENGLISH_XL_A1);
|
||||
pEntry->SetFormula(rEntry.maFormula, rDoc, rAddr, formula::FormulaGrammar::GRAM_ENGLISH_XL_A1);
|
||||
}
|
||||
|
||||
pEntry->SetMode(rEntry.meMode);
|
||||
@@ -338,11 +338,11 @@ ScColorScaleEntry* ConvertToModel( const ColorScaleRuleModelEntry& rEntry, ScDoc
|
||||
|
||||
}
|
||||
|
||||
void ColorScaleRule::AddEntries( ScColorScaleFormat* pFormat, ScDocument* pDoc, const ScAddress& rAddr )
|
||||
void ColorScaleRule::AddEntries( ScColorScaleFormat* pFormat, ScDocument& rDoc, const ScAddress& rAddr )
|
||||
{
|
||||
for(const ColorScaleRuleModelEntry & rEntry : maColorScaleRuleEntries)
|
||||
{
|
||||
ScColorScaleEntry* pEntry = ConvertToModel( rEntry, pDoc, rAddr );
|
||||
ScColorScaleEntry* pEntry = ConvertToModel( rEntry, rDoc, rAddr );
|
||||
|
||||
pFormat->AddEntry( pEntry );
|
||||
}
|
||||
@@ -388,10 +388,10 @@ void DataBarRule::importAttribs( const AttributeList& rAttribs )
|
||||
mxFormat->mnMaxLength = rAttribs.getUnsigned( XML_maxLength, 90);
|
||||
}
|
||||
|
||||
void DataBarRule::SetData( ScDataBarFormat* pFormat, ScDocument* pDoc, const ScAddress& rAddr )
|
||||
void DataBarRule::SetData( ScDataBarFormat* pFormat, ScDocument& rDoc, const ScAddress& rAddr )
|
||||
{
|
||||
ScColorScaleEntry* pUpperEntry = ConvertToModel(*mpUpperLimit, pDoc, rAddr);
|
||||
ScColorScaleEntry* pLowerEntry = ConvertToModel(*mpLowerLimit, pDoc, rAddr);
|
||||
ScColorScaleEntry* pUpperEntry = ConvertToModel(*mpUpperLimit, rDoc, rAddr);
|
||||
ScColorScaleEntry* pLowerEntry = ConvertToModel(*mpLowerLimit, rDoc, rAddr);
|
||||
|
||||
mxFormat->mpUpperLimit.reset( pUpperEntry );
|
||||
mxFormat->mpLowerLimit.reset( pLowerEntry );
|
||||
@@ -466,11 +466,11 @@ void IconSetRule::importIcon(const AttributeList& rAttribs)
|
||||
mxFormatData->maCustomVector.emplace_back(eIconSetType, nIndex);
|
||||
}
|
||||
|
||||
void IconSetRule::SetData( ScIconSetFormat* pFormat, ScDocument* pDoc, const ScAddress& rPos )
|
||||
void IconSetRule::SetData( ScIconSetFormat* pFormat, ScDocument& rDoc, const ScAddress& rPos )
|
||||
{
|
||||
for(const ColorScaleRuleModelEntry & rEntry : maEntries)
|
||||
{
|
||||
ScColorScaleEntry* pModelEntry = ConvertToModel( rEntry, pDoc, rPos );
|
||||
ScColorScaleEntry* pModelEntry = ConvertToModel( rEntry, rDoc, rPos );
|
||||
mxFormatData->m_Entries.emplace_back(pModelEntry);
|
||||
}
|
||||
|
||||
@@ -1037,7 +1037,7 @@ void CondFormatRule::finalizeImport()
|
||||
}
|
||||
|
||||
ScDocument& rDoc = getScDocument();
|
||||
ScCondDateFormatEntry* pFormatEntry = new ScCondDateFormatEntry(&rDoc);
|
||||
ScCondDateFormatEntry* pFormatEntry = new ScCondDateFormatEntry(rDoc);
|
||||
pFormatEntry->SetDateType(eDateType);
|
||||
OUString aStyleName = getStyles().createDxfStyle( maModel.mnDxfId );
|
||||
pFormatEntry->SetStyleName( aStyleName );
|
||||
@@ -1047,28 +1047,28 @@ void CondFormatRule::finalizeImport()
|
||||
else if( mpColor )
|
||||
{
|
||||
ScDocument& rDoc = getScDocument();
|
||||
ScColorScaleFormat* pFormatEntry = new ScColorScaleFormat(&rDoc);
|
||||
ScColorScaleFormat* pFormatEntry = new ScColorScaleFormat(rDoc);
|
||||
|
||||
mpFormat->AddEntry(pFormatEntry);
|
||||
|
||||
mpColor->AddEntries( pFormatEntry, &rDoc, aPos );
|
||||
mpColor->AddEntries( pFormatEntry, rDoc, aPos );
|
||||
}
|
||||
else if (mpDataBar)
|
||||
{
|
||||
ScDocument& rDoc = getScDocument();
|
||||
ScDataBarFormat* pFormatEntry = new ScDataBarFormat(&rDoc);
|
||||
ScDataBarFormat* pFormatEntry = new ScDataBarFormat(rDoc);
|
||||
|
||||
mpFormat->AddEntry(pFormatEntry);
|
||||
mpDataBar->SetData( pFormatEntry, &rDoc, aPos );
|
||||
mpDataBar->SetData( pFormatEntry, rDoc, aPos );
|
||||
|
||||
}
|
||||
else if(mpIconSet)
|
||||
{
|
||||
ScDocument& rDoc = getScDocument();
|
||||
ScIconSetFormat* pFormatEntry = new ScIconSetFormat(&rDoc);
|
||||
ScIconSetFormat* pFormatEntry = new ScIconSetFormat(rDoc);
|
||||
|
||||
mpFormat->AddEntry(pFormatEntry);
|
||||
mpIconSet->SetData( pFormatEntry, &rDoc, aPos );
|
||||
mpIconSet->SetData( pFormatEntry, rDoc, aPos );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1119,7 +1119,7 @@ void CondFormat::importConditionalFormatting( const AttributeList& rAttribs )
|
||||
{
|
||||
getAddressConverter().convertToCellRangeList( maModel.maRanges, rAttribs.getString( XML_sqref, OUString() ), getSheetIndex(), true );
|
||||
maModel.mbPivot = rAttribs.getBool( XML_pivot, false );
|
||||
mpFormat = new ScConditionalFormat(0, &getScDocument());
|
||||
mpFormat = new ScConditionalFormat(0, getScDocument());
|
||||
}
|
||||
|
||||
std::unique_ptr<CondFormatRule> CondFormat::importCfRule( const AttributeList& rAttribs )
|
||||
@@ -1135,7 +1135,7 @@ void CondFormat::importCondFormatting( SequenceInputStream& rStrm )
|
||||
rStrm.skip( 8 );
|
||||
rStrm >> aRanges;
|
||||
getAddressConverter().convertToCellRangeList( maModel.maRanges, aRanges, getSheetIndex(), true );
|
||||
mpFormat = new ScConditionalFormat(0, &getScDocument());
|
||||
mpFormat = new ScConditionalFormat(0, getScDocument());
|
||||
}
|
||||
|
||||
void CondFormat::importCfRule( SequenceInputStream& rStrm )
|
||||
@@ -1194,9 +1194,9 @@ CondFormatRef CondFormatBuffer::importConditionalFormatting( const AttributeList
|
||||
|
||||
namespace {
|
||||
|
||||
ScConditionalFormat* findFormatByRange(const ScRangeList& rRange, const ScDocument* pDoc, SCTAB nTab)
|
||||
ScConditionalFormat* findFormatByRange(const ScRangeList& rRange, const ScDocument& rDoc, SCTAB nTab)
|
||||
{
|
||||
ScConditionalFormatList* pList = pDoc->GetCondFormList(nTab);
|
||||
ScConditionalFormatList* pList = rDoc.GetCondFormList(nTab);
|
||||
for (auto const& it : *pList)
|
||||
{
|
||||
if (it->GetRange() == rRange)
|
||||
@@ -1248,7 +1248,7 @@ void CondFormatBuffer::finalizeImport()
|
||||
size_t nExtCFIndex = 0;
|
||||
for (const auto& rxExtCondFormat : maExtCondFormats)
|
||||
{
|
||||
ScDocument* pDoc = &getScDocument();
|
||||
ScDocument& rDoc = getScDocument();
|
||||
const ScRangeList& rRange = rxExtCondFormat->getRange();
|
||||
RangeMap::iterator it = aRangeMap.find(rRange);
|
||||
if (it != aRangeMap.end())
|
||||
@@ -1262,7 +1262,7 @@ void CondFormatBuffer::finalizeImport()
|
||||
std::unique_ptr<CondFormatRule> xRule = rCondFormat.createRule();
|
||||
if (ScDataBarFormat *pData = dynamic_cast<ScDataBarFormat*>(rxEntry.get()))
|
||||
updateImport(pData->GetDataBarData());
|
||||
ScFormatEntry* pNewEntry = rxEntry->Clone(pDoc);
|
||||
ScFormatEntry* pNewEntry = rxEntry->Clone(rDoc);
|
||||
sal_Int32 nPriority = rPriorities[nEntryIdx];
|
||||
if (nPriority == -1)
|
||||
nPriority = mnNonPrioritizedRuleNextPriority++;
|
||||
@@ -1317,24 +1317,24 @@ void CondFormatBuffer::finalizeImport()
|
||||
continue;
|
||||
}
|
||||
|
||||
ScDocument* pDoc = &getScDocument();
|
||||
ScDocument& rDoc = getScDocument();
|
||||
const ScRangeList& rRange = rxExtCondFormat->getRange();
|
||||
SCTAB nTab = rRange.front().aStart.Tab();
|
||||
ScConditionalFormat* pFormat = findFormatByRange(rRange, pDoc, nTab);
|
||||
ScConditionalFormat* pFormat = findFormatByRange(rRange, rDoc, nTab);
|
||||
if (!pFormat)
|
||||
{
|
||||
// create new conditional format and insert it
|
||||
auto pNewFormat = std::make_unique<ScConditionalFormat>(0, pDoc);
|
||||
auto pNewFormat = std::make_unique<ScConditionalFormat>(0, rDoc);
|
||||
pFormat = pNewFormat.get();
|
||||
pNewFormat->SetRange(rRange);
|
||||
sal_uInt32 nKey = pDoc->AddCondFormat(std::move(pNewFormat), nTab);
|
||||
pDoc->AddCondFormatData(rRange, nTab, nKey);
|
||||
sal_uInt32 nKey = rDoc.AddCondFormat(std::move(pNewFormat), nTab);
|
||||
rDoc.AddCondFormatData(rRange, nTab, nKey);
|
||||
}
|
||||
|
||||
const std::vector< std::unique_ptr<ScFormatEntry> >& rEntries = rxExtCondFormat->getEntries();
|
||||
for (const auto& rxEntry : rEntries)
|
||||
{
|
||||
pFormat->AddEntry(rxEntry->Clone(pDoc));
|
||||
pFormat->AddEntry(rxEntry->Clone(rDoc));
|
||||
}
|
||||
|
||||
++nExtCFIndex;
|
||||
|
||||
@@ -151,7 +151,7 @@ ContextHandlerRef ExtConditionalFormattingContext::onCreateContext(sal_Int32 nEl
|
||||
ScDocument& rDoc = getScDocument();
|
||||
SCTAB nTab = getSheetIndex();
|
||||
ScAddress aPos(0, 0, nTab);
|
||||
mpCurrentRule->SetData(&rIconSet, &rDoc, aPos);
|
||||
mpCurrentRule->SetData(&rIconSet, rDoc, aPos);
|
||||
mpCurrentRule.reset();
|
||||
}
|
||||
if (nElement == XLS14_TOKEN(cfRule))
|
||||
@@ -170,7 +170,7 @@ ContextHandlerRef ExtConditionalFormattingContext::onCreateContext(sal_Int32 nEl
|
||||
if (aExt == getExtLst().end())
|
||||
{
|
||||
pInfo = new ScDataBarFormatData();
|
||||
auto pFormat = std::make_unique<ScDataBarFormat>(&getScDocument());
|
||||
auto pFormat = std::make_unique<ScDataBarFormat>(getScDocument());
|
||||
pFormat->SetDataBarData(pInfo);
|
||||
getCondFormats().importExtFormatEntries().push_back(std::move(pFormat));
|
||||
}
|
||||
@@ -189,7 +189,7 @@ ContextHandlerRef ExtConditionalFormattingContext::onCreateContext(sal_Int32 nEl
|
||||
{
|
||||
ScDocument& rDoc = getScDocument();
|
||||
mpCurrentRule.reset(new IconSetRule(*this));
|
||||
maEntries.push_back(std::make_unique<ScIconSetFormat>(&rDoc));
|
||||
maEntries.push_back(std::make_unique<ScIconSetFormat>(rDoc));
|
||||
return new IconSetContext(*this, mpCurrentRule.get());
|
||||
}
|
||||
else if (aType == "cellIs")
|
||||
|
||||
@@ -708,7 +708,7 @@ void ScOrcusSheetProperties::set_merge_cell_range(const orcus::spreadsheet::rang
|
||||
ScOrcusConditionalFormat::ScOrcusConditionalFormat(SCTAB nTab, ScDocument& rDoc)
|
||||
: mnTab(nTab)
|
||||
, mrDoc(rDoc)
|
||||
, mpCurrentFormat(new ScConditionalFormat(0, &mrDoc))
|
||||
, mpCurrentFormat(new ScConditionalFormat(0, mrDoc))
|
||||
, meEntryType(ScFormatEntry::Type::Condition)
|
||||
{
|
||||
}
|
||||
@@ -854,7 +854,7 @@ void ScOrcusConditionalFormat::set_range(os::row_t row_start, os::col_t col_star
|
||||
void ScOrcusConditionalFormat::commit_format()
|
||||
{
|
||||
SAL_INFO("sc.orcus.condformat", "commit_format");
|
||||
mpCurrentFormat.reset(new ScConditionalFormat(0, &mrDoc));
|
||||
mpCurrentFormat.reset(new ScConditionalFormat(0, mrDoc));
|
||||
}
|
||||
|
||||
ScOrcusSheet::ScOrcusSheet(ScDocumentImport& rDoc, const ScOrcusGlobalSettings& rGS, SCTAB nTab,
|
||||
|
||||
@@ -103,7 +103,7 @@ ScXMLConditionalFormatContext::ScXMLConditionalFormatContext( ScXMLImport& rImpo
|
||||
ScRangeStringConverter::GetRangeListFromString(aRangeList, sRange, *pDoc,
|
||||
formula::FormulaGrammar::CONV_ODF);
|
||||
|
||||
mxFormat.reset(new ScConditionalFormat(0, pDoc));
|
||||
mxFormat.reset(new ScConditionalFormat(0, *pDoc));
|
||||
mxFormat->SetRange(aRangeList);
|
||||
}
|
||||
|
||||
@@ -375,7 +375,7 @@ ScXMLColorScaleFormatContext::ScXMLColorScaleFormatContext( ScXMLImport& rImport
|
||||
ScXMLImportContext( rImport ),
|
||||
pColorScaleFormat(nullptr)
|
||||
{
|
||||
pColorScaleFormat = new ScColorScaleFormat(GetScImport().GetDocument());
|
||||
pColorScaleFormat = new ScColorScaleFormat(*GetScImport().GetDocument());
|
||||
pFormat->AddEntry(pColorScaleFormat);
|
||||
}
|
||||
|
||||
@@ -451,7 +451,7 @@ ScXMLDataBarFormatContext::ScXMLDataBarFormatContext( ScXMLImport& rImport,
|
||||
}
|
||||
}
|
||||
|
||||
ScDataBarFormat* pDataBarFormat = new ScDataBarFormat(rImport.GetDocument());
|
||||
ScDataBarFormat* pDataBarFormat = new ScDataBarFormat(*rImport.GetDocument());
|
||||
mpFormatData = new ScDataBarFormatData();
|
||||
pDataBarFormat->SetDataBarData(mpFormatData);
|
||||
if(!sGradient.isEmpty())
|
||||
@@ -587,7 +587,7 @@ ScXMLIconSetFormatContext::ScXMLIconSetFormatContext(ScXMLImport& rImport,
|
||||
}
|
||||
}
|
||||
|
||||
ScIconSetFormat* pIconSetFormat = new ScIconSetFormat(GetScImport().GetDocument());
|
||||
ScIconSetFormat* pIconSetFormat = new ScIconSetFormat(*GetScImport().GetDocument());
|
||||
ScIconSetFormatData* pIconSetFormatData = new ScIconSetFormatData;
|
||||
|
||||
if(!sShowValue.isEmpty())
|
||||
@@ -1002,7 +1002,7 @@ ScXMLDateContext::ScXMLDateContext( ScXMLImport& rImport,
|
||||
}
|
||||
}
|
||||
|
||||
ScCondDateFormatEntry* pFormatEntry = new ScCondDateFormatEntry(GetScImport().GetDocument());
|
||||
ScCondDateFormatEntry* pFormatEntry = new ScCondDateFormatEntry(*GetScImport().GetDocument());
|
||||
pFormatEntry->SetStyleName(sStyle);
|
||||
pFormatEntry->SetDateType(getDateFromString(sDateType));
|
||||
pFormat->AddEntry(pFormatEntry);
|
||||
|
||||
@@ -453,7 +453,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > XMLTableStyleContext::
|
||||
if( nElement == XML_ELEMENT(STYLE, XML_MAP) )
|
||||
{
|
||||
if(!mpCondFormat)
|
||||
mpCondFormat = new ScConditionalFormat( 0, GetScImport().GetDocument() );
|
||||
mpCondFormat = new ScConditionalFormat( 0, *GetScImport().GetDocument() );
|
||||
ScXMLMapContext* pMapContext = new ScXMLMapContext(GetImport(), nElement, xAttrList);
|
||||
xContext = pMapContext;
|
||||
mpCondFormat->AddEntry(pMapContext->CreateConditionEntry());
|
||||
|
||||
@@ -145,7 +145,7 @@ std::unique_ptr<ScConditionalFormat> ScCondFormatList::GetConditionalFormat() co
|
||||
if(maEntries.empty())
|
||||
return nullptr;
|
||||
|
||||
std::unique_ptr<ScConditionalFormat> pFormat(new ScConditionalFormat(0, &mrDoc));
|
||||
std::unique_ptr<ScConditionalFormat> pFormat(new ScConditionalFormat(0, mrDoc));
|
||||
pFormat->SetRange(maRanges);
|
||||
|
||||
for(auto & rEntry: maEntries)
|
||||
|
||||
@@ -813,7 +813,7 @@ void ScColorScale2FrmtEntry::Init()
|
||||
|
||||
ScFormatEntry* ScColorScale2FrmtEntry::createColorscaleEntry() const
|
||||
{
|
||||
ScColorScaleFormat* pColorScale = new ScColorScaleFormat(&mrDoc);
|
||||
ScColorScaleFormat* pColorScale = new ScColorScaleFormat(mrDoc);
|
||||
pColorScale->AddEntry(createColorScaleEntry(*mxLbEntryTypeMin, *mxLbColMin, *mxEdMin, mrDoc, maPos));
|
||||
pColorScale->AddEntry(createColorScaleEntry(*mxLbEntryTypeMax, *mxLbColMax, *mxEdMax, mrDoc, maPos));
|
||||
return pColorScale;
|
||||
@@ -961,7 +961,7 @@ void ScColorScale3FrmtEntry::Init()
|
||||
|
||||
ScFormatEntry* ScColorScale3FrmtEntry::createColorscaleEntry() const
|
||||
{
|
||||
ScColorScaleFormat* pColorScale = new ScColorScaleFormat(&mrDoc);
|
||||
ScColorScaleFormat* pColorScale = new ScColorScaleFormat(mrDoc);
|
||||
pColorScale->AddEntry(createColorScaleEntry(*mxLbEntryTypeMin, *mxLbColMin, *mxEdMin, mrDoc, maPos));
|
||||
if (mxLbColorFormat->get_active() == 1)
|
||||
pColorScale->AddEntry(createColorScaleEntry(*mxLbEntryTypeMiddle, *mxLbColMiddle, *mxEdMiddle, mrDoc, maPos));
|
||||
@@ -1171,7 +1171,7 @@ ScFormatEntry* ScDataBarFrmtEntry::createDatabarEntry() const
|
||||
*mxEdDataBarMin, mrDoc, maPos);
|
||||
SetColorScaleEntry(mpDataBarData->mpUpperLimit.get(), *mxLbDataBarMaxType,
|
||||
*mxEdDataBarMax, mrDoc, maPos);
|
||||
ScDataBarFormat* pDataBar = new ScDataBarFormat(&mrDoc);
|
||||
ScDataBarFormat* pDataBar = new ScDataBarFormat(mrDoc);
|
||||
pDataBar->SetDataBarData(new ScDataBarFormatData(*mpDataBarData));
|
||||
return pDataBar;
|
||||
}
|
||||
@@ -1310,7 +1310,7 @@ void ScDateFrmtEntry::Notify( SfxBroadcaster&, const SfxHint& rHint )
|
||||
|
||||
ScFormatEntry* ScDateFrmtEntry::GetEntry() const
|
||||
{
|
||||
ScCondDateFormatEntry* pNewEntry = new ScCondDateFormatEntry(&mrDoc);
|
||||
ScCondDateFormatEntry* pNewEntry = new ScCondDateFormatEntry(mrDoc);
|
||||
condformat::ScCondFormatDateType eType = static_cast<condformat::ScCondFormatDateType>(mxLbDateEntry->get_active());
|
||||
pNewEntry->SetDateType(eType);
|
||||
pNewEntry->SetStyleName(mxLbStyle->get_active_text());
|
||||
@@ -1549,7 +1549,7 @@ void ScIconSetFrmtEntry::SetInactive()
|
||||
|
||||
ScFormatEntry* ScIconSetFrmtEntry::GetEntry() const
|
||||
{
|
||||
ScIconSetFormat* pFormat = new ScIconSetFormat(&mrDoc);
|
||||
ScIconSetFormat* pFormat = new ScIconSetFormat(mrDoc);
|
||||
|
||||
ScIconSetFormatData* pData = new ScIconSetFormatData;
|
||||
pData->eIconSetType = static_cast<ScIconSetType>(mxLbIconSetType->get_active());
|
||||
|
||||
@@ -235,7 +235,7 @@ IMPL_LINK(ConditionalFormatEasyDialog, ButtonPressed, weld::Button&, rButton, vo
|
||||
{
|
||||
if (&rButton == mxButtonOk.get())
|
||||
{
|
||||
std::unique_ptr<ScConditionalFormat> pFormat(new ScConditionalFormat(0, &mrDocument));
|
||||
std::unique_ptr<ScConditionalFormat> pFormat(new ScConditionalFormat(0, mrDocument));
|
||||
|
||||
OUString sExpression1 = (mxNumberEntry->get_visible() && mxAllInputs->get_visible()
|
||||
? mxNumberEntry->get_text()
|
||||
|
||||
@@ -1545,7 +1545,7 @@ void ScCellRangesBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
|
||||
if ( rDoc.HasUnoRefUndo() )
|
||||
pUndoRanges.reset(new ScRangeList( aRanges ));
|
||||
|
||||
if ( aRanges.UpdateReference( pRefHint->GetMode(), &rDoc, pRefHint->GetRange(),
|
||||
if ( aRanges.UpdateReference( pRefHint->GetMode(), rDoc, pRefHint->GetRange(),
|
||||
pRefHint->GetDx(), pRefHint->GetDy(), pRefHint->GetDz() ) )
|
||||
{
|
||||
AdjustUpdatedRanges(pRefHint->GetMode());
|
||||
@@ -1929,7 +1929,7 @@ uno::Any SAL_CALL ScCellRangesBase::getPropertyDefault( const OUString& aPropert
|
||||
formula::FormulaGrammar::mapAPItoGrammar( bEnglish, bXML));
|
||||
|
||||
aAny <<= uno::Reference<sheet::XSheetConditionalEntries>(
|
||||
new ScTableConditionalFormat( &rDoc, 0, aRanges[0].aStart.Tab(), eGrammar ));
|
||||
new ScTableConditionalFormat( rDoc, 0, aRanges[0].aStart.Tab(), eGrammar ));
|
||||
}
|
||||
break;
|
||||
case SC_WID_UNO_VALIDAT:
|
||||
@@ -2242,7 +2242,7 @@ void ScCellRangesBase::SetOnePropertyValue( const SfxItemPropertyMapEntry* pEntr
|
||||
// Then we can apply new conditional format if there is one
|
||||
if (pFormat->getCount())
|
||||
{
|
||||
auto pNew = std::make_unique<ScConditionalFormat>( 0, &rDoc ); // Index will be set on inserting
|
||||
auto pNew = std::make_unique<ScConditionalFormat>( 0, rDoc ); // Index will be set on inserting
|
||||
pFormat->FillFormat( *pNew, rDoc, eGrammar );
|
||||
pNew->SetRange( aRanges );
|
||||
pDocShell->GetDocFunc().ReplaceConditionalFormat( 0, std::move(pNew), nTab, aRanges );
|
||||
@@ -2409,7 +2409,7 @@ void ScCellRangesBase::GetOnePropertyValue( const SfxItemPropertyMapEntry* pEntr
|
||||
if(!rIndex.empty())
|
||||
nIndex = rIndex[0];
|
||||
rAny <<= uno::Reference<sheet::XSheetConditionalEntries>(
|
||||
new ScTableConditionalFormat( &rDoc, nIndex, aRanges.front().aStart.Tab(), eGrammar ));
|
||||
new ScTableConditionalFormat( rDoc, nIndex, aRanges.front().aStart.Tab(), eGrammar ));
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -8388,7 +8388,7 @@ void ScCellsObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
|
||||
if ( rHint.GetId() == SfxHintId::ScUpdateRef )
|
||||
{
|
||||
auto pRefHint = static_cast<const ScUpdateRefHint*>(&rHint);
|
||||
aRanges.UpdateReference( pRefHint->GetMode(), &pDocShell->GetDocument(), pRefHint->GetRange(),
|
||||
aRanges.UpdateReference( pRefHint->GetMode(), pDocShell->GetDocument(), pRefHint->GetRange(),
|
||||
pRefHint->GetDx(), pRefHint->GetDy(), pRefHint->GetDz() );
|
||||
}
|
||||
else if ( rHint.GetId() == SfxHintId::Dying )
|
||||
@@ -8502,7 +8502,7 @@ void ScCellsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHint )
|
||||
const ScUpdateRefHint* pRefHint = static_cast<const ScUpdateRefHint*>(&rHint);
|
||||
if (pDocShell)
|
||||
{
|
||||
aRanges.UpdateReference( pRefHint->GetMode(), &pDocShell->GetDocument(), pRefHint->GetRange(),
|
||||
aRanges.UpdateReference( pRefHint->GetMode(), pDocShell->GetDocument(), pRefHint->GetRange(),
|
||||
pRefHint->GetDx(), pRefHint->GetDy(), pRefHint->GetDz() );
|
||||
|
||||
pMark.reset(); // recreate from moved area
|
||||
@@ -8510,7 +8510,7 @@ void ScCellsEnumeration::Notify( SfxBroadcaster&, const SfxHint& rHint )
|
||||
if (!bAtEnd) // adjust aPos
|
||||
{
|
||||
ScRangeList aNew { ScRange(aPos) };
|
||||
aNew.UpdateReference( pRefHint->GetMode(), &pDocShell->GetDocument(), pRefHint->GetRange(),
|
||||
aNew.UpdateReference( pRefHint->GetMode(), pDocShell->GetDocument(), pRefHint->GetRange(),
|
||||
pRefHint->GetDx(), pRefHint->GetDy(), pRefHint->GetDz() );
|
||||
if (aNew.size()==1)
|
||||
{
|
||||
|
||||
@@ -2832,7 +2832,7 @@ void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint
|
||||
|
||||
const ScUpdateRefHint& rRef = static_cast<const ScUpdateRefHint&>(rHint);
|
||||
bool bChanged = aRanges.UpdateReference(
|
||||
rRef.GetMode(), m_pDocument, rRef.GetRange(), rRef.GetDx(), rRef.GetDy(), rRef.GetDz());
|
||||
rRef.GetMode(), *m_pDocument, rRef.GetRange(), rRef.GetDx(), rRef.GetDy(), rRef.GetDz());
|
||||
|
||||
if (bChanged)
|
||||
{
|
||||
|
||||
@@ -355,7 +355,7 @@ sal_Int32 ScCondFormatsObj::createByRange(const uno::Reference< sheet::XSheetCel
|
||||
|
||||
SCTAB nTab = aCoreRange[0].aStart.Tab();
|
||||
|
||||
auto pNewFormat = std::make_unique<ScConditionalFormat>(0, &mpDocShell->GetDocument());
|
||||
auto pNewFormat = std::make_unique<ScConditionalFormat>(0, mpDocShell->GetDocument());
|
||||
pNewFormat->SetRange(aCoreRange);
|
||||
return mpDocShell->GetDocument().AddCondFormat(std::move(pNewFormat), nTab);
|
||||
}
|
||||
@@ -479,19 +479,19 @@ void ScCondFormatObj::createEntry(const sal_Int32 nType, const sal_Int32 nPos)
|
||||
rDoc, pFormat->GetRange().GetTopLeftCorner(), u""_ustr);
|
||||
break;
|
||||
case sheet::ConditionEntryType::COLORSCALE:
|
||||
pNewEntry = new ScColorScaleFormat(&rDoc);
|
||||
pNewEntry = new ScColorScaleFormat(rDoc);
|
||||
static_cast<ScColorScaleFormat*>(pNewEntry)->EnsureSize();
|
||||
break;
|
||||
case sheet::ConditionEntryType::DATABAR:
|
||||
pNewEntry = new ScDataBarFormat(&rDoc);
|
||||
pNewEntry = new ScDataBarFormat(rDoc);
|
||||
static_cast<ScDataBarFormat*>(pNewEntry)->EnsureSize();
|
||||
break;
|
||||
case sheet::ConditionEntryType::ICONSET:
|
||||
pNewEntry = new ScIconSetFormat(&rDoc);
|
||||
pNewEntry = new ScIconSetFormat(rDoc);
|
||||
static_cast<ScIconSetFormat*>(pNewEntry)->EnsureSize();
|
||||
break;
|
||||
case sheet::ConditionEntryType::DATE:
|
||||
pNewEntry = new ScCondDateFormatEntry(&rDoc);
|
||||
pNewEntry = new ScCondDateFormatEntry(rDoc);
|
||||
break;
|
||||
default:
|
||||
SAL_WARN("sc", "unknown conditional format type");
|
||||
|
||||
@@ -1225,7 +1225,7 @@ void ScDataPilotTableObj::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
|
||||
auto pRefHint = static_cast<const ScUpdateRefHint*>(&rHint);
|
||||
ScRange aRange( 0, 0, nTab );
|
||||
ScRangeList aRanges( aRange );
|
||||
if ( aRanges.UpdateReference( pRefHint->GetMode(), &GetDocShell()->GetDocument(), pRefHint->GetRange(),
|
||||
if ( aRanges.UpdateReference( pRefHint->GetMode(), GetDocShell()->GetDocument(), pRefHint->GetRange(),
|
||||
pRefHint->GetDx(), pRefHint->GetDy(), pRefHint->GetDz() ) &&
|
||||
aRanges.size() == 1 )
|
||||
{
|
||||
|
||||
@@ -142,14 +142,14 @@ ScCondFormatEntryItem::ScCondFormatEntryItem() :
|
||||
}
|
||||
|
||||
ScTableConditionalFormat::ScTableConditionalFormat(
|
||||
const ScDocument* pDoc, sal_uLong nKey, SCTAB nTab, FormulaGrammar::Grammar eGrammar)
|
||||
const ScDocument& rDoc, sal_uLong nKey, SCTAB nTab, FormulaGrammar::Grammar eGrammar)
|
||||
{
|
||||
// read the entry from the document...
|
||||
|
||||
if ( !(pDoc && nKey) )
|
||||
if ( !nKey )
|
||||
return;
|
||||
|
||||
ScConditionalFormatList* pList = pDoc->GetCondFormList(nTab);
|
||||
ScConditionalFormatList* pList = rDoc.GetCondFormList(nTab);
|
||||
if (!pList)
|
||||
return;
|
||||
|
||||
@@ -158,7 +158,7 @@ ScTableConditionalFormat::ScTableConditionalFormat(
|
||||
return;
|
||||
|
||||
// During save to XML.
|
||||
if (pDoc->IsInExternalReferenceMarking())
|
||||
if (rDoc.IsInExternalReferenceMarking())
|
||||
pFormat->MarkUsedExternalReferences();
|
||||
|
||||
size_t nEntryCount = pFormat->size();
|
||||
|
||||
@@ -2272,7 +2272,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
|
||||
const SfxInt16Item* pParam = rReq.GetArg<SfxInt16Item>(FN_PARAM_1);
|
||||
if (pParam)
|
||||
{
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(0, &rDoc);
|
||||
auto pFormat = std::make_unique<ScConditionalFormat>(0, rDoc);
|
||||
pFormat->SetRange(aRangeList);
|
||||
|
||||
if (nSlot == SID_OPENDLG_ICONSET)
|
||||
@@ -2280,7 +2280,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
|
||||
ScIconSetType eIconSetType = limit_cast<ScIconSetType>(pParam->GetValue(), IconSet_3Arrows, IconSet_5Boxes);
|
||||
const int nSteps = ScIconSetFormat::getIconSetElements(eIconSetType);
|
||||
|
||||
ScIconSetFormat* pEntry = new ScIconSetFormat(&rDoc);
|
||||
ScIconSetFormat* pEntry = new ScIconSetFormat(rDoc);
|
||||
ScIconSetFormatData* pIconSetFormatData = new ScIconSetFormatData(eIconSetType);
|
||||
|
||||
pIconSetFormatData->m_Entries.emplace_back(new ScColorScaleEntry(0, COL_RED, COLORSCALE_PERCENT));
|
||||
@@ -2358,7 +2358,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
|
||||
sal_uInt16 nTheme = pParam->GetValue();
|
||||
if (nTheme < aScaleThemes.size())
|
||||
{
|
||||
ScColorScaleFormat* pFormatEntry = new ScColorScaleFormat(&rDoc);
|
||||
ScColorScaleFormat* pFormatEntry = new ScColorScaleFormat(rDoc);
|
||||
|
||||
auto& aTheme = aScaleThemes[nTheme];
|
||||
|
||||
@@ -2402,7 +2402,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
|
||||
sal_uInt16 nTheme = pParam->GetValue();
|
||||
if (nTheme < aDatabarThemes.size())
|
||||
{
|
||||
ScDataBarFormat* pFormatEntry = new ScDataBarFormat(&rDoc);
|
||||
ScDataBarFormat* pFormatEntry = new ScDataBarFormat(rDoc);
|
||||
|
||||
auto& aTheme = aDatabarThemes[nTheme];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user