[Libreoffice-commits] .: 2 commits - sc/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Sep 28 11:17:47 PDT 2012
sc/source/filter/xml/xmlstyli.cxx | 25 ++++++++++++-------------
sc/source/filter/xml/xmlstyli.hxx | 1 +
2 files changed, 13 insertions(+), 13 deletions(-)
New commits:
commit 8e94ac21b72145d59992eaee4fbbd065e597b3d6
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Sep 28 20:16:18 2012 +0200
use a as prefix for local variables
Change-Id: Id4652eb986c02044e27cd4e91863d5ed97465860
diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx
index 2b6c58b..687c841 100644
--- a/sc/source/filter/xml/xmlstyli.cxx
+++ b/sc/source/filter/xml/xmlstyli.cxx
@@ -428,13 +428,13 @@ void XMLTableStyleContext::ApplyCondFormat( uno::Sequence<table::CellRangeAddres
if(!mpCondFormat || GetScImport().HasNewCondFormatData())
return;
- ScRangeList rRange;
+ ScRangeList aRangeList;
sal_Int32 nRanges = xCellRanges.getLength();
for(sal_Int32 i = 0; i < nRanges; ++i)
{
table::CellRangeAddress aAddress = xCellRanges[i];
ScRange aRange( aAddress.StartColumn, aAddress.StartRow, aAddress.Sheet, aAddress.EndColumn, aAddress.EndRow, aAddress.Sheet );
- rRange.Join( aRange, false );
+ aRangeList.Join( aRange, false );
}
ScDocument* pDoc = GetScImport().GetDocument();
@@ -447,17 +447,17 @@ void XMLTableStyleContext::ApplyCondFormat( uno::Sequence<table::CellRangeAddres
{
ScRangeList& rRangeList = itr->GetRangeList();
sal_uInt32 nCondId = itr->GetKey();
- size_t n = rRange.size();
+ size_t n = aRangeList.size();
for(size_t i = 0; i < n; ++i)
{
- const ScRange* pRange = rRange[i];
+ const ScRange* pRange = aRangeList[i];
rRangeList.Join(*pRange);
}
ScPatternAttr aPattern( pDoc->GetPool() );
aPattern.GetItemSet().Put( SfxUInt32Item( ATTR_CONDITIONAL, nCondId ) );
ScMarkData aMarkData;
- aMarkData.MarkFromRangeList(rRange, true);
+ aMarkData.MarkFromRangeList(aRangeList, true);
pDoc->ApplySelectionPattern( aPattern , aMarkData);
break;
@@ -469,12 +469,12 @@ void XMLTableStyleContext::ApplyCondFormat( uno::Sequence<table::CellRangeAddres
mbDeleteCondFormat = false;
sal_uLong nIndex = pDoc->AddCondFormat(mpCondFormat, nTab );
mpCondFormat->SetKey(nIndex);
- mpCondFormat->AddRange(rRange);
+ mpCondFormat->AddRange(aRangeList);
ScPatternAttr aPattern( pDoc->GetPool() );
aPattern.GetItemSet().Put( SfxUInt32Item( ATTR_CONDITIONAL, nIndex ) );
ScMarkData aMarkData;
- aMarkData.MarkFromRangeList(rRange, true);
+ aMarkData.MarkFromRangeList(aRangeList, true);
pDoc->ApplySelectionPattern( aPattern , aMarkData);
}
commit c5d4e2cf96e5c28634ed6968f87b476e8a2a5850
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Sep 28 20:14:17 2012 +0200
fetime of mpCondFormat is more complex, fdo#55379
Change-Id: I2b34f9fefdfdfa245ab73f8691090cbde8bcd34e
diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx
index a05276f..2b6c58b 100644
--- a/sc/source/filter/xml/xmlstyli.cxx
+++ b/sc/source/filter/xml/xmlstyli.cxx
@@ -390,12 +390,15 @@ XMLTableStyleContext::XMLTableStyleContext( ScXMLImport& rImport,
nNumberFormat(-1),
nLastSheet(-1),
bParentSet(false),
- mpCondFormat(NULL)
+ mpCondFormat(NULL),
+ mbDeleteCondFormat(true)
{
}
XMLTableStyleContext::~XMLTableStyleContext()
{
+ if(mbDeleteCondFormat)
+ delete mpCondFormat;
}
SvXMLImportContext *XMLTableStyleContext::CreateChildContext(
@@ -442,11 +445,6 @@ void XMLTableStyleContext::ApplyCondFormat( uno::Sequence<table::CellRangeAddres
{
if(itr->EqualEntries(*mpCondFormat))
{
- // we don't need the new cond format entry now
- // the found one is the same and we just need to add the range to it
- delete mpCondFormat;
- mpCondFormat = NULL;
-
ScRangeList& rRangeList = itr->GetRangeList();
sal_uInt32 nCondId = itr->GetKey();
size_t n = rRange.size();
@@ -468,6 +466,7 @@ void XMLTableStyleContext::ApplyCondFormat( uno::Sequence<table::CellRangeAddres
if(mpCondFormat)
{
+ mbDeleteCondFormat = false;
sal_uLong nIndex = pDoc->AddCondFormat(mpCondFormat, nTab );
mpCondFormat->SetKey(nIndex);
mpCondFormat->AddRange(rRange);
diff --git a/sc/source/filter/xml/xmlstyli.hxx b/sc/source/filter/xml/xmlstyli.hxx
index def3509..28ea475 100644
--- a/sc/source/filter/xml/xmlstyli.hxx
+++ b/sc/source/filter/xml/xmlstyli.hxx
@@ -101,6 +101,7 @@ class XMLTableStyleContext : public XMLPropStyleContext
SCTAB nLastSheet;
bool bParentSet;
ScConditionalFormat* mpCondFormat;
+ bool mbDeleteCondFormat;
const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
More information about the Libreoffice-commits
mailing list