/[packages]/cauldron/libreoffice/current/SOURCES/0001-Resolves-rhbz-1193971-clear-hard-coded-char-props-in.patch
ViewVC logotype

Contents of /cauldron/libreoffice/current/SOURCES/0001-Resolves-rhbz-1193971-clear-hard-coded-char-props-in.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 817012 - (show annotations) (download)
Wed Feb 25 19:44:21 2015 UTC (4 years, 6 months ago) by tv
File size: 4935 byte(s)
- 4.4.1 RC2
1 From af05bc34c64d20e4936735b3506e9533623dac7d Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
3 Date: Wed, 18 Feb 2015 15:04:45 +0000
4 Subject: [PATCH] Resolves: rhbz#1193971 clear hard-coded char props in table
5 cells...
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 like we do already for shapes. So now when attempting to set replacement char
11 properties on the entire cell, clear any hard-coded sub ranges within the
12 existing paragraphs.
13
14 This extends the effort of
15 commit a217f3cb2dce71a4322f78ceb45edb6f171b2b65
16 Author: Matúš Kukan <matus.kukan@collabora.com>
17 Date: Tue Aug 26 10:16:34 2014 +0200
18
19 bnc#770711: Make changing table text color in impress always work
20
21 to encompass all character properties, not just color
22
23 Change-Id: If8b426c3531b4678868d8351426db32c3c558650
24 (cherry picked from commit b14259b946686c753c0df42c519fc2537e871601)
25 ---
26 svx/source/svdraw/svdedtv1.cxx | 38 ++++++++++++++++++++++----------------
27 svx/source/table/cell.cxx | 15 +++++++++++++--
28 2 files changed, 35 insertions(+), 18 deletions(-)
29
30 diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
31 index 1ba5f40..62c4cff 100644
32 --- a/svx/source/svdraw/svdedtv1.cxx
33 +++ b/svx/source/svdraw/svdedtv1.cxx
34 @@ -953,6 +953,26 @@ void SdrEditView::MergeAttrFromMarked(SfxItemSet& rAttr, bool bOnlyHardAttr) con
35 }
36 }
37
38 +std::vector<sal_uInt16> GetAllCharPropIds(const SfxItemSet& rSet)
39 +{
40 + std::vector<sal_uInt16> aCharWhichIds;
41 + {
42 + SfxItemIter aIter(rSet);
43 + const SfxPoolItem* pItem=aIter.FirstItem();
44 + while (pItem!=NULL)
45 + {
46 + if (!IsInvalidItem(pItem))
47 + {
48 + sal_uInt16 nWhich = pItem->Which();
49 + if (nWhich>=EE_CHAR_START && nWhich<=EE_CHAR_END)
50 + aCharWhichIds.push_back( nWhich );
51 + }
52 + pItem=aIter.NextItem();
53 + }
54 + }
55 + return aCharWhichIds;
56 +}
57 +
58 void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll)
59 {
60 if (AreObjectsMarked())
61 @@ -977,25 +997,11 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll)
62 }
63 #endif
64
65 - // #103836# if the user thets character attributes to the complete shape,
66 + // #103836# if the user sets character attributes to the complete shape,
67 // we want to remove all hard set character attributes with same
68 // which ids from the text. We do that later but here we remember
69 // all character attribute which id's that are set.
70 - std::vector<sal_uInt16> aCharWhichIds;
71 - {
72 - SfxItemIter aIter(rAttr);
73 - const SfxPoolItem* pItem=aIter.FirstItem();
74 - while( pItem!=NULL )
75 - {
76 - if (!IsInvalidItem(pItem))
77 - {
78 - sal_uInt16 nWhich = pItem->Which();
79 - if (nWhich>=EE_CHAR_START && nWhich<=EE_CHAR_END)
80 - aCharWhichIds.push_back( nWhich );
81 - }
82 - pItem=aIter.NextItem();
83 - }
84 - }
85 + std::vector<sal_uInt16> aCharWhichIds(GetAllCharPropIds(rAttr));
86
87 // To make Undo reconstruct text attributes correctly after Format.Standard
88 bool bHasEEItems=SearchOutlinerItems(rAttr,bReplaceAll);
89 diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
90 index e81370c..3468283 100644
91 --- a/svx/source/table/cell.cxx
92 +++ b/svx/source/table/cell.cxx
93 @@ -139,6 +139,8 @@ SdrText* CellTextProvider::getText(sal_Int32 nIndex) const
94
95 }
96
97 +extern std::vector<sal_uInt16> GetAllCharPropIds(const SfxItemSet& rSet);
98 +
99 namespace sdr
100 {
101 namespace properties
102 @@ -261,12 +263,21 @@ namespace sdr
103
104 sal_Int32 nParaCount(pOutliner->GetParagraphCount());
105
106 + // if the user sets character attributes to the complete
107 + // cell we want to remove all hard set character attributes
108 + // with same which ids from the text
109 + std::vector<sal_uInt16> aCharWhichIds(GetAllCharPropIds(rSet));
110 +
111 for(sal_Int32 nPara = 0; nPara < nParaCount; nPara++)
112 {
113 SfxItemSet aSet(pOutliner->GetParaAttribs(nPara));
114 aSet.Put(rSet);
115 - if (aSet.GetItemState(EE_CHAR_COLOR, false) == SfxItemState::SET)
116 - pOutliner->RemoveCharAttribs( nPara, EE_CHAR_COLOR );
117 +
118 + for (std::vector<sal_uInt16>::const_iterator aI = aCharWhichIds.begin(); aI != aCharWhichIds.end(); ++aI)
119 + {
120 + pOutliner->RemoveCharAttribs(nPara, *aI);
121 + }
122 +
123 pOutliner->SetParaAttribs(nPara, aSet);
124 }
125
126 --
127 1.9.3
128

  ViewVC Help
Powered by ViewVC 1.1.26