basegfx/CppunitTest_basegfx.mk | 1 basegfx/test/basegfx1d.cxx | 63 ------------------------------ basegfx/test/basegfx2d.cxx | 5 -- sc/inc/conditio.hxx | 2 sc/qa/unit/ucalc.cxx | 24 +++++------ sc/source/core/data/conditio.cxx | 14 +----- sc/source/core/data/table2.cxx | 2 sc/source/core/data/table4.cxx | 10 ++-- sc/source/filter/excel/xicontent.cxx | 2 sc/source/filter/oox/condformatbuffer.cxx | 2 sc/source/filter/xml/xmlcondformat.cxx | 2 sc/source/filter/xml/xmlstyli.cxx | 2 sc/source/ui/condformat/condformatdlg.cxx | 4 - sc/source/ui/unoobj/cellsuno.cxx | 2 14 files changed, 32 insertions(+), 103 deletions(-)
New commits: commit dcd291330b95e6493e341ae40ef1afe1482fcd24 Author: Markus Mohrhard <[email protected]> Date: Sun Jan 18 16:35:42 2015 +0100 rename AddRange to SetRange Change-Id: I696fcbd2896aefda38314457b6838874262ad111 diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx index 743c950..341e032 100644 --- a/sc/inc/conditio.hxx +++ b/sc/inc/conditio.hxx @@ -393,7 +393,7 @@ public: ScConditionalFormat* Clone(ScDocument* pNewDoc = NULL) const; void AddEntry( ScFormatEntry* pNew ); - void AddRange( const ScRangeList& rRanges ); + void SetRange( const ScRangeList& rRanges ); const ScRangeList& GetRange() const { return maRanges; } // don't use the same name as for the const version ScRangeList& GetRangeList() { return maRanges; } diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index fe01944..eb4454f 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -3660,7 +3660,7 @@ void Test::testCopyPasteSkipEmptyConditionalFormatting() m_pDoc->SetCondFormList(pCondFormatList, 0); ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc); - pFormat->AddRange(aDestRange); + pFormat->SetRange(aDestRange); sal_uLong nCondFormatKey = m_pDoc->AddCondFormat(pFormat, 0); // Prepare a clipboard content interleaved with empty cells. @@ -3675,7 +3675,7 @@ void Test::testCopyPasteSkipEmptyConditionalFormatting() aClipDoc.SetValue(4,5,0,2); ScConditionalFormat* pClipFormat = new ScConditionalFormat(2, &aClipDoc); - pClipFormat->AddRange(aSrcRange); + pClipFormat->SetRange(aSrcRange); aClipDoc.AddCondFormat(pClipFormat, 0); // Create undo document. @@ -5466,7 +5466,7 @@ void Test::testCondFormatINSDEL() ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc); ScRangeList aRangeList(ScRange(0,0,0,0,3,0)); - pFormat->AddRange(aRangeList); + pFormat->SetRange(aRangeList); ScCondFormatEntry* pEntry = new ScCondFormatEntry(SC_COND_DIRECT,"=B2","",m_pDoc,ScAddress(0,0,0),ScGlobal::GetRscString(STR_STYLENAME_RESULT)); pFormat->AddEntry(pEntry); @@ -5490,7 +5490,7 @@ void Test::testCondFormatInsertCol() ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc); ScRangeList aRangeList(ScRange(0,0,0,3,3,0)); - pFormat->AddRange(aRangeList); + pFormat->SetRange(aRangeList); ScCondFormatEntry* pEntry = new ScCondFormatEntry(SC_COND_DIRECT,"=B2","",m_pDoc,ScAddress(0,0,0),ScGlobal::GetRscString(STR_STYLENAME_RESULT)); pFormat->AddEntry(pEntry); @@ -5512,7 +5512,7 @@ void Test::testCondFormatInsertRow() ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc); ScRangeList aRangeList(ScRange(0,0,0,3,3,0)); - pFormat->AddRange(aRangeList); + pFormat->SetRange(aRangeList); ScCondFormatEntry* pEntry = new ScCondFormatEntry(SC_COND_DIRECT,"=B2","",m_pDoc,ScAddress(0,0,0),ScGlobal::GetRscString(STR_STYLENAME_RESULT)); pFormat->AddEntry(pEntry); @@ -5533,7 +5533,7 @@ void Test::testCondFormatInsertDeleteSheets() // Add a conditional format to B2:B4. ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc); - pFormat->AddRange(ScRange(1,1,0,1,3,0)); + pFormat->SetRange(ScRange(1,1,0,1,3,0)); sal_uLong nKey = m_pDoc->AddCondFormat(pFormat, 0); @@ -5640,7 +5640,7 @@ void Test::testCondCopyPaste() ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc); ScRange aCondFormatRange(0,0,0,3,3,0); ScRangeList aRangeList(aCondFormatRange); - pFormat->AddRange(aRangeList); + pFormat->SetRange(aRangeList); ScCondFormatEntry* pEntry = new ScCondFormatEntry(SC_COND_DIRECT,"=B2","",m_pDoc,ScAddress(0,0,0),ScGlobal::GetRscString(STR_STYLENAME_RESULT)); pFormat->AddEntry(pEntry); @@ -5674,7 +5674,7 @@ void Test::testCondCopyPasteSingleCell() ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc); ScRange aCondFormatRange(0,0,0,3,3,0); ScRangeList aRangeList(aCondFormatRange); - pFormat->AddRange(aRangeList); + pFormat->SetRange(aRangeList); ScCondFormatEntry* pEntry = new ScCondFormatEntry(SC_COND_DIRECT,"=B2","",m_pDoc,ScAddress(0,0,0),ScGlobal::GetRscString(STR_STYLENAME_RESULT)); pFormat->AddEntry(pEntry); @@ -5708,7 +5708,7 @@ void Test::testCondCopyPasteSingleCellToRange() ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc); ScRange aCondFormatRange(0,0,0,3,3,0); ScRangeList aRangeList(aCondFormatRange); - pFormat->AddRange(aRangeList); + pFormat->SetRange(aRangeList); ScCondFormatEntry* pEntry = new ScCondFormatEntry(SC_COND_DIRECT,"=B2","",m_pDoc,ScAddress(0,0,0),ScGlobal::GetRscString(STR_STYLENAME_RESULT)); pFormat->AddEntry(pEntry); @@ -5750,7 +5750,7 @@ void Test::testCondCopyPasteSheetBetweenDoc() ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc); ScRange aCondFormatRange(0,0,0,3,3,0); ScRangeList aRangeList(aCondFormatRange); - pFormat->AddRange(aRangeList); + pFormat->SetRange(aRangeList); ScCondFormatEntry* pEntry = new ScCondFormatEntry(SC_COND_DIRECT,"=B2","",m_pDoc,ScAddress(0,0,0),ScGlobal::GetRscString(STR_STYLENAME_RESULT)); pFormat->AddEntry(pEntry); @@ -5772,7 +5772,7 @@ void Test::testCondCopyPasteSheet() ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc); ScRange aCondFormatRange(0,0,0,3,3,0); ScRangeList aRangeList(aCondFormatRange); - pFormat->AddRange(aRangeList); + pFormat->SetRange(aRangeList); ScCondFormatEntry* pEntry = new ScCondFormatEntry(SC_COND_DIRECT,"=B2","",m_pDoc,ScAddress(0,0,0),ScGlobal::GetRscString(STR_STYLENAME_RESULT)); pFormat->AddEntry(pEntry); @@ -5805,7 +5805,7 @@ void Test::testIconSet() ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc); ScRangeList aRangeList(ScRange(0,0,0,0,0,0)); - pFormat->AddRange(aRangeList); + pFormat->SetRange(aRangeList); ScIconSetFormat* pEntry = new ScIconSetFormat(m_pDoc); ScIconSetFormatData* pData = new ScIconSetFormatData; diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index 0db3471..6967a33 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -1815,7 +1815,7 @@ ScConditionalFormat* ScConditionalFormat::Clone(ScDocument* pNewDoc) const pNew->maEntries.push_back( pNewEntry ); pNewEntry->SetParent(pNew); } - pNew->AddRange( maRanges ); + pNew->SetRange( maRanges ); return pNew; } @@ -1836,7 +1836,7 @@ bool ScConditionalFormat::EqualEntries( const ScConditionalFormat& r ) const return true; } -void ScConditionalFormat::AddRange( const ScRangeList& rRanges ) +void ScConditionalFormat::SetRange( const ScRangeList& rRanges ) { maRanges = rRanges; SAL_WARN_IF(maRanges.empty(), "sc", "the conditional format range is empty! will result in a crash later!"); diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 160da7f..082ea90 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -584,7 +584,7 @@ void ScTable::CopyConditionalFormat( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCRO ScRangeList aIntersectedRange = rCondFormatRange.GetIntersectedRange(aOldRange); ScConditionalFormat* pNewFormat = itr->Clone(pDocument); - pNewFormat->AddRange(aIntersectedRange); + pNewFormat->SetRange(aIntersectedRange); sc::RefUpdateContext aRefCxt(*pDocument); aRefCxt.meMode = URM_COPY; aRefCxt.maRange = aNewRange; diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index ee52681..b7840ee 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -620,7 +620,7 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScConditionalFormat* pCondFormat = mpCondFormatList->GetFormat(*itr); ScRangeList aRange = pCondFormat->GetRange(); aRange.Join(ScRange(nCol, nY1, nTab, nCol, nY2, nTab)); - pCondFormat->AddRange(aRange); + pCondFormat->SetRange(aRange); } } @@ -650,7 +650,7 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScConditionalFormat* pCondFormat = mpCondFormatList->GetFormat(*itr); ScRangeList aRange = pCondFormat->GetRange(); aRange.Join(ScRange(nCol, nRow, nTab, nCol, nRow, nTab)); - pCondFormat->AddRange(aRange); + pCondFormat->SetRange(aRange); } } @@ -1571,7 +1571,7 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScConditionalFormat* pCondFormat = mpCondFormatList->GetFormat(*itr); ScRangeList aRange = pCondFormat->GetRange(); aRange.Join(ScRange(nCol, nIMin, nTab, nCol, nIMax, nTab)); - pCondFormat->AddRange(aRange); + pCondFormat->SetRange(aRange); } } else @@ -1588,7 +1588,7 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScConditionalFormat* pCondFormat = mpCondFormatList->GetFormat(*itr); ScRangeList aRange = pCondFormat->GetRange(); aRange.Join(ScRange(nCol, nAtRow, nTab, nCol, nAtRow, nTab)); - pCondFormat->AddRange(aRange); + pCondFormat->SetRange(aRange); } } } @@ -1606,7 +1606,7 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScConditionalFormat* pCondFormat = mpCondFormatList->GetFormat(*itr); ScRangeList aRange = pCondFormat->GetRange(); aRange.Join(ScRange(nAtCol, static_cast<SCROW>(nRow), nTab, nAtCol, static_cast<SCROW>(nRow), nTab)); - pCondFormat->AddRange(aRange); + pCondFormat->SetRange(aRange); } } } diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx index 247e897..c248e9d 100644 --- a/sc/source/filter/excel/xicontent.cxx +++ b/sc/source/filter/excel/xicontent.cxx @@ -657,7 +657,7 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm ) mxScCondFmt.reset( new ScConditionalFormat( nKey, GetDocPtr() ) ); if(maRanges.size() > 1) maRanges.Join(*maRanges[0], true); - mxScCondFmt->AddRange(maRanges); + mxScCondFmt->SetRange(maRanges); } ScCondFormatEntry* pEntry = new ScCondFormatEntry( eMode, xTokArr1.get(), pTokArr2.get(), GetDocPtr(), rPos, aStyleName ); diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx index 6937ac7..3deec93 100644 --- a/sc/source/filter/oox/condformatbuffer.cxx +++ b/sc/source/filter/oox/condformatbuffer.cxx @@ -993,7 +993,7 @@ void CondFormat::finalizeImport() aList.Append(aRange); } rDoc.AddCondFormatData( aList, nTab, nIndex ); - mpFormat->AddRange(aList); + mpFormat->SetRange(aList); } CondFormatRuleRef CondFormat::createRule() diff --git a/sc/source/filter/xml/xmlcondformat.cxx b/sc/source/filter/xml/xmlcondformat.cxx index ad49a09..911f5c0 100644 --- a/sc/source/filter/xml/xmlcondformat.cxx +++ b/sc/source/filter/xml/xmlcondformat.cxx @@ -87,7 +87,7 @@ ScXMLConditionalFormatContext::ScXMLConditionalFormatContext( ScXMLImport& rImpo formula::FormulaGrammar::CONV_ODF); mxFormat.reset(new ScConditionalFormat(0, GetScImport().GetDocument())); - mxFormat->AddRange(maRange); + mxFormat->SetRange(maRange); } SvXMLImportContext* ScXMLConditionalFormatContext::CreateChildContext( sal_uInt16 nPrefix, diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx index 9c65adb5..89087e0 100644 --- a/sc/source/filter/xml/xmlstyli.cxx +++ b/sc/source/filter/xml/xmlstyli.cxx @@ -534,7 +534,7 @@ void XMLTableStyleContext::ApplyCondFormat( const uno::Sequence<table::CellRange { sal_uLong nIndex = pDoc->AddCondFormat(mpCondFormat, nTab ); mpCondFormat->SetKey(nIndex); - mpCondFormat->AddRange(aRangeList); + mpCondFormat->SetRange(aRangeList); pDoc->AddCondFormatData( aRangeList, nTab, nIndex ); mbDeleteCondFormat = false; diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index b868e20..ad260e4 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -163,7 +163,7 @@ ScConditionalFormat* ScCondFormatList::GetConditionalFormat() const pFormat->AddEntry(pEntry); } - pFormat->AddRange(maRanges); + pFormat->SetRange(maRanges); return pFormat; } @@ -506,7 +506,7 @@ ScConditionalFormat* ScCondFormatDlg::GetConditionalFormat() const ScConditionalFormat* pFormat = mpCondFormList->GetConditionalFormat(); if(nFlags & SCA_VALID && !aRange.empty() && pFormat) - pFormat->AddRange(aRange); + pFormat->SetRange(aRange); else { delete pFormat; diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 6d1e54a..5f1c7ee 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -2415,7 +2415,7 @@ void ScCellRangesBase::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pE { ScConditionalFormat* pNew = new ScConditionalFormat( 0, &rDoc ); // Index wird beim Einfuegen gesetzt pFormat->FillFormat( *pNew, &rDoc, eGrammar ); - pNew->AddRange( aRanges ); + pNew->SetRange( aRanges ); pDocShell->GetDocFunc().ReplaceConditionalFormat( 0, pNew, nTab, aRanges ); } } commit 22aebd531dbd6230214b4dc7f5342694f9b448af Author: Markus Mohrhard <[email protected]> Date: Sun Jan 18 16:33:48 2015 +0100 remove duplicated code Change-Id: I7c125bd27f5662b2f5bbcafb51aebdac9e272d08 diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index 6e57acb..0db3471 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -2208,14 +2208,7 @@ void ScConditionalFormatList::UpdateReference( sc::RefUpdateContext& rCxt ) if (rCxt.meMode == URM_INSDEL) { // need to check which must be deleted - iterator itr = begin(); - while(itr != end()) - { - if(itr->GetRange().empty()) - maConditionalFormats.erase(itr++); - else - ++itr; - } + CheckAllEntries(); } } commit 4caed2a28a1cf44a61b2cbbf45737e31a63c9bb8 Author: Markus Mohrhard <[email protected]> Date: Sun Jan 18 16:33:26 2015 +0100 add warning for empty conditional format ranges Change-Id: I54a87b8cf6ffc48f8e850379aebb4abba7a327b5 diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index 5b1bbef..6e57acb 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -1839,6 +1839,7 @@ bool ScConditionalFormat::EqualEntries( const ScConditionalFormat& r ) const void ScConditionalFormat::AddRange( const ScRangeList& rRanges ) { maRanges = rRanges; + SAL_WARN_IF(maRanges.empty(), "sc", "the conditional format range is empty! will result in a crash later!"); } void ScConditionalFormat::AddEntry( ScFormatEntry* pNew ) commit b2462b3fea5f2477ceff51518070eeb64cea2bcf Author: Markus Mohrhard <[email protected]> Date: Sat Jan 17 03:19:46 2015 +0100 remove unused file Change-Id: I8cc33007e99da38869daa48ff898593abc52c4ac diff --git a/basegfx/CppunitTest_basegfx.mk b/basegfx/CppunitTest_basegfx.mk index 8f34f3b..fdffba3 100644 --- a/basegfx/CppunitTest_basegfx.mk +++ b/basegfx/CppunitTest_basegfx.mk @@ -26,7 +26,6 @@ $(eval $(call gb_CppunitTest_use_libraries,basegfx,\ )) $(eval $(call gb_CppunitTest_add_exception_objects,basegfx,\ - basegfx/test/basegfx1d \ basegfx/test/basegfx2d \ basegfx/test/basegfx3d \ basegfx/test/boxclipper \ diff --git a/basegfx/test/basegfx1d.cxx b/basegfx/test/basegfx1d.cxx deleted file mode 100644 index 9058956..0000000 --- a/basegfx/test/basegfx1d.cxx +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include <sal/types.h> - -#include <cppunit/TestAssert.h> -#include <cppunit/TestFixture.h> -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/plugin/TestPlugIn.h> - -namespace basegfx1d -{ - -class b1drange : public CppUnit::TestFixture -{ -public: - // initialise your test code values here. - void setUp() SAL_OVERRIDE - { - } - - void tearDown() SAL_OVERRIDE - { - } - - // insert your test code here. - // this is only demonstration code - void EmptyMethod() - { - // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1); - } - - // Change the following lines only, if you add, remove or rename - // member functions of the current class, - // because these macros are need by auto register mechanism. - - CPPUNIT_TEST_SUITE(b1drange); - CPPUNIT_TEST(EmptyMethod); - CPPUNIT_TEST_SUITE_END(); -}; // class b1drange - -CPPUNIT_TEST_SUITE_REGISTRATION(basegfx1d::b1drange); -} // namespace basegfx1d - -CPPUNIT_PLUGIN_IMPLEMENT(); - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basegfx/test/basegfx2d.cxx b/basegfx/test/basegfx2d.cxx index d9c3fe25..717fde0 100644 --- a/basegfx/test/basegfx2d.cxx +++ b/basegfx/test/basegfx2d.cxx @@ -20,6 +20,7 @@ #include <cppunit/TestAssert.h> #include <cppunit/TestFixture.h> #include <cppunit/extensions/HelperMacros.h> +#include <cppunit/plugin/TestPlugIn.h> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> @@ -1292,8 +1293,6 @@ CPPUNIT_TEST_SUITE_REGISTRATION(basegfx2d::b2dtuple); CPPUNIT_TEST_SUITE_REGISTRATION(basegfx2d::bcolor); } // namespace basegfx2d -// this macro creates an empty function, which will called by the RegisterAllFunctions() -// to let the user the possibility to also register some functions by hand. -// NOADDITIONAL; +CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
