summaryrefslogtreecommitdiff
path: root/svx/source/table
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-02-18 15:04:45 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-02-18 16:14:00 +0000
commitb14259b946686c753c0df42c519fc2537e871601 (patch)
tree48543c0c9acd4cb80359505c8127d9369d22cb03 /svx/source/table
parent1f893617eeec4aea9cd460b633dc4004b6cf20ba (diff)
Resolves: rhbz#1193971 clear hard-coded char props in table cells...
like we do already for shapes. So now when attempting to set replacement char properties on the entire cell, clear any hard-coded sub ranges within the existing paragraphs. This extends the effort of commit a217f3cb2dce71a4322f78ceb45edb6f171b2b65 Author: Matúš Kukan <matus.kukan@collabora.com> Date: Tue Aug 26 10:16:34 2014 +0200 bnc#770711: Make changing table text color in impress always work to encompass all character properties, not just color Change-Id: If8b426c3531b4678868d8351426db32c3c558650
Diffstat (limited to 'svx/source/table')
-rw-r--r--svx/source/table/cell.cxx15
1 files changed, 13 insertions, 2 deletions
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index e81370c144bb..34682832ae3f 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -139,6 +139,8 @@ SdrText* CellTextProvider::getText(sal_Int32 nIndex) const
}
+extern std::vector<sal_uInt16> GetAllCharPropIds(const SfxItemSet& rSet);
+
namespace sdr
{
namespace properties
@@ -261,12 +263,21 @@ namespace sdr
sal_Int32 nParaCount(pOutliner->GetParagraphCount());
+ // if the user sets character attributes to the complete
+ // cell we want to remove all hard set character attributes
+ // with same which ids from the text
+ std::vector<sal_uInt16> aCharWhichIds(GetAllCharPropIds(rSet));
+
for(sal_Int32 nPara = 0; nPara < nParaCount; nPara++)
{
SfxItemSet aSet(pOutliner->GetParaAttribs(nPara));
aSet.Put(rSet);
- if (aSet.GetItemState(EE_CHAR_COLOR, false) == SfxItemState::SET)
- pOutliner->RemoveCharAttribs( nPara, EE_CHAR_COLOR );
+
+ for (std::vector<sal_uInt16>::const_iterator aI = aCharWhichIds.begin(); aI != aCharWhichIds.end(); ++aI)
+ {
+ pOutliner->RemoveCharAttribs(nPara, *aI);
+ }
+
pOutliner->SetParaAttribs(nPara, aSet);
}