[libreoffice/f21] Resolves: rhbz#1193971 clear hard coded char props in cells
Caolán McNamara
caolanm at fedoraproject.org
Wed Feb 18 16:22:52 UTC 2015
commit 46148de531bf9ca9bfbb76a9e4e04a7aca70055f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Feb 18 16:22:40 2015 +0000
Resolves: rhbz#1193971 clear hard coded char props in cells
...bz-1193971-clear-hard-coded-char-props-in.patch | 132 ++++++++++++++++++++
libreoffice.spec | 6 +-
2 files changed, 137 insertions(+), 1 deletions(-)
---
diff --git a/0001-Resolves-rhbz-1193971-clear-hard-coded-char-props-in.patch b/0001-Resolves-rhbz-1193971-clear-hard-coded-char-props-in.patch
new file mode 100644
index 0000000..c9a2ec2
--- /dev/null
+++ b/0001-Resolves-rhbz-1193971-clear-hard-coded-char-props-in.patch
@@ -0,0 +1,132 @@
+From fc40c8ce262a5d9ba65c27dc525c1d040c8ed8ad Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm at redhat.com>
+Date: Wed, 18 Feb 2015 15:04:45 +0000
+Subject: [PATCH] Resolves: rhbz#1193971 clear hard-coded char props in table
+ cells...
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+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 at 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
+
+(cherry picked from commit b14259b946686c753c0df42c519fc2537e871601)
+
+Conflicts:
+ svx/source/table/cell.cxx
+
+Change-Id: If8b426c3531b4678868d8351426db32c3c558650
+---
+ svx/source/svdraw/svdedtv1.cxx | 38 ++++++++++++++++++++++----------------
+ svx/source/table/cell.cxx | 15 +++++++++++++--
+ 2 files changed, 35 insertions(+), 18 deletions(-)
+
+diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
+index 7945d2c..928f9e2 100644
+--- a/svx/source/svdraw/svdedtv1.cxx
++++ b/svx/source/svdraw/svdedtv1.cxx
+@@ -953,6 +953,26 @@ void SdrEditView::MergeAttrFromMarked(SfxItemSet& rAttr, bool bOnlyHardAttr) con
+ }
+ }
+
++std::vector<sal_uInt16> GetAllCharPropIds(const SfxItemSet& rSet)
++{
++ std::vector<sal_uInt16> aCharWhichIds;
++ {
++ SfxItemIter aIter(rSet);
++ const SfxPoolItem* pItem=aIter.FirstItem();
++ while (pItem!=NULL)
++ {
++ if (!IsInvalidItem(pItem))
++ {
++ sal_uInt16 nWhich = pItem->Which();
++ if (nWhich>=EE_CHAR_START && nWhich<=EE_CHAR_END)
++ aCharWhichIds.push_back( nWhich );
++ }
++ pItem=aIter.NextItem();
++ }
++ }
++ return aCharWhichIds;
++}
++
+ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll)
+ {
+ if (AreObjectsMarked())
+@@ -977,25 +997,11 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll)
+ }
+ #endif
+
+- // #103836# if the user thets character attributes to the complete shape,
++ // #103836# if the user sets character attributes to the complete shape,
+ // we want to remove all hard set character attributes with same
+ // which ids from the text. We do that later but here we remember
+ // all character attribute which id's that are set.
+- std::vector<sal_uInt16> aCharWhichIds;
+- {
+- SfxItemIter aIter(rAttr);
+- const SfxPoolItem* pItem=aIter.FirstItem();
+- while( pItem!=NULL )
+- {
+- if (!IsInvalidItem(pItem))
+- {
+- sal_uInt16 nWhich = pItem->Which();
+- if (nWhich>=EE_CHAR_START && nWhich<=EE_CHAR_END)
+- aCharWhichIds.push_back( nWhich );
+- }
+- pItem=aIter.NextItem();
+- }
+- }
++ std::vector<sal_uInt16> aCharWhichIds(GetAllCharPropIds(rAttr));
+
+ // To make Undo reconstruct text attributes correctly after Format.Standard
+ bool bHasEEItems=SearchOutlinerItems(rAttr,bReplaceAll);
+diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
+index 8d64dbc..a55d069 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) == SFX_ITEM_ON)
+- pOutliner->QuickRemoveCharAttribs( 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);
+ }
+
+--
+1.9.3
+
diff --git a/libreoffice.spec b/libreoffice.spec
index a78e9e3..84a217f 100644
--- a/libreoffice.spec
+++ b/libreoffice.spec
@@ -46,7 +46,7 @@ Summary: Free Software Productivity Suite
Name: libreoffice
Epoch: 1
Version: %{libo_version}.2
-Release: 2%{?libo_prerelease}%{?dist}
+Release: 3%{?libo_prerelease}%{?dist}
License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic and MPLv2.0 and CC0
Group: Applications/Productivity
URL: http://www.libreoffice.org/
@@ -365,6 +365,7 @@ Patch70: 0001-don-t-strip-font-names-of-apparent-script-suffixes-a.patch
Patch71: 0001-rhbz-1177022-vcl-fix-PDF-embedding-of-Type-1-fonts.patch
Patch72: 0001-During-DocumentRedlineManager-SetRedlineMode-the-arr.patch
Patch73: 0001-Resolves-fdo-84887-TabBar-ImplShowPage-crash.patch
+Patch74: 0001-Resolves-rhbz-1193971-clear-hard-coded-char-props-in.patch
%define instdir %{_libdir}
%define baseinstdir %{instdir}/libreoffice
@@ -2336,6 +2337,9 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
%endif
%changelog
+* Wed Feb 18 2015 Caolán McNamara <caolanm at redhat.com> - 1:4.3.6.2-3
+- Resolves: rhbz#1193971 clear hard coded char props in cells
+
* Fri Feb 06 2015 Stephan Bergmann <sbergman at redhat.com> - 1:4.3.6.2-2
- Resolves: rhbz#1123710 crash opening Draw
More information about the scm-commits
mailing list