- Add patch to fix bsc#1028504:

* 0001-undo-clone.patch
- Add patch to fix test failure on 32bit:
  * 0001-watermark.patch

OBS-URL: https://build.opensuse.org/package/show/LibreOffice:Factory/libreoffice?expand=0&rev=505
This commit is contained in:
Tomáš Chvátal 2017-06-13 13:51:49 +00:00 committed by Git OBS Bridge
parent 9d7d4b6875
commit e2a783f2c0
4 changed files with 180 additions and 0 deletions

90
0001-undo-clone.patch Normal file
View File

@ -0,0 +1,90 @@
From cd38a25d41e1ce2acad25b1b5b2a5e77239e36ed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tam=C3=A1s=20Zolnai?= <tamas.zolnai@collabora.com>
Date: Mon, 12 Jun 2017 14:34:59 +0200
Subject: tdf#108480: Undo from clone formating does not remove vertical
alignment
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In the related change:
d36aa2ba3132ce62a370b7260ca620642cbf7dbf
wrong method was used to set cell properties, which does
not handle undo actions, so use the proper function.
Other issue was related to undo handling of vertical text
alignment in general. In some cases undo actions were lost
after user clicked out of the cell. It is because vertical
alignment is not affecting the outliner and so the related
undo actions were just dropped in EndTextEdit() method.
Change-Id: I3a6a95fac711056a658a3dee616733939cd13330
Reviewed-on: https://gerrit.libreoffice.org/38699
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
(cherry picked from commit 37d8ac12902506f4185e10f1de4f566dbaf53e42)
Reviewed-on: https://gerrit.libreoffice.org/38724
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index ff71c07..ea521d7 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -2228,9 +2228,8 @@ void SdrObjEditView::TakeFormatPaintBrush( std::shared_ptr< SfxItemSet >& rForma
if( pObj && (pObj->GetObjInventor() == SdrInventor::Default ) && (pObj->GetObjIdentifier() == OBJ_TABLE) )
{
auto pTable = static_cast<const sdr::table::SdrTableObj*>(pObj);
- if (pTable->getActiveCell().is()) {
- SfxItemSet const & rSet = pTable->GetActiveCellItemSet();
- rFormatSet->Put(rSet);
+ if (mxSelectionController.is() && pTable->getActiveCell().is()) {
+ mxSelectionController->GetAttributes(*rFormatSet, false);
}
}
}
@@ -2378,8 +2377,8 @@ void SdrObjEditView::ApplyFormatPaintBrush( SfxItemSet& rFormatSet, bool bNoChar
if( pObj && (pObj->GetObjInventor() == SdrInventor::Default) && (pObj->GetObjIdentifier() == OBJ_TABLE) )
{
auto pTable = static_cast<sdr::table::SdrTableObj*>(pObj);
- if (pTable->getActiveCell().is()) {
- pTable->SetMergedItemSetAndBroadcastOnActiveCell(rFormatSet);
+ if (pTable->getActiveCell().is() && mxSelectionController.is()) {
+ mxSelectionController->SetAttributes(rFormatSet, false);
}
}
}
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 4c51d41..ef58d32 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -1768,18 +1768,19 @@ bool SdrTableObj::BegTextEdit(SdrOutliner& rOutl)
void SdrTableObj::EndTextEdit(SdrOutliner& rOutl)
{
- if(rOutl.IsModified())
+
+ if (GetModel() && GetModel()->IsUndoEnabled() && !mpImpl->maUndos.empty())
{
- if( GetModel() && GetModel()->IsUndoEnabled() )
- {
- // These actions should be on the undo stack after text edit.
- for (std::unique_ptr<SdrUndoAction>& pAction : mpImpl->maUndos)
- GetModel()->AddUndo(pAction.release());
- mpImpl->maUndos.clear();
+ // These actions should be on the undo stack after text edit.
+ for (std::unique_ptr<SdrUndoAction>& pAction : mpImpl->maUndos)
+ GetModel()->AddUndo(pAction.release());
+ mpImpl->maUndos.clear();
- GetModel()->AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*this) );
- }
+ GetModel()->AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*this));
+ }
+ if(rOutl.IsModified())
+ {
OutlinerParaObject* pNewText = nullptr;
Paragraph* p1stPara = rOutl.GetParagraph( 0 );
sal_Int32 nParaAnz = rOutl.GetParagraphCount();
--
cgit v0.10.2

77
0001-watermark.patch Normal file
View File

@ -0,0 +1,77 @@
From 42353b95629322f51e059337ab06579ffb1c6934 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Szymon=20K=C5=82os?= <szymon.klos@collabora.com>
Date: Fri, 9 Jun 2017 11:10:28 +0200
Subject: Watermark: fix rotation calculation
* when angle > 180 was used calculated value was 0
* values are rounded
Change-Id: I0cade407883a60d8d802b487668882e95f42ddce
Reviewed-on: https://gerrit.libreoffice.org/38597
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 8d6965c..94c066e9 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -266,6 +266,29 @@ void SwEditShell::SetClassification(const OUString& rName, SfxClassificationPoli
}
}
+sal_Int16 lcl_GetAngle(const drawing::HomogenMatrix3& rMatrix)
+{
+ basegfx::B2DHomMatrix aTransformation;
+ basegfx::B2DTuple aScale;
+ basegfx::B2DTuple aTranslate;
+ double fRotate = 0;
+ double fShear = 0;
+
+ aTransformation.set(0, 0, rMatrix.Line1.Column1);
+ aTransformation.set(0, 1, rMatrix.Line1.Column2);
+ aTransformation.set(0, 2, rMatrix.Line1.Column3);
+ aTransformation.set(1, 0, rMatrix.Line2.Column1);
+ aTransformation.set(1, 1, rMatrix.Line2.Column2);
+ aTransformation.set(1, 2, rMatrix.Line2.Column3);
+ aTransformation.set(2, 0, rMatrix.Line3.Column1);
+ aTransformation.set(2, 1, rMatrix.Line3.Column2);
+ aTransformation.set(2, 2, rMatrix.Line3.Column3);
+
+ aTransformation.decompose(aScale, aTranslate, fRotate, fShear);
+ sal_Int16 nDeg = round(basegfx::rad2deg(fRotate));
+ return nDeg < 0 ? round(nDeg) * -1 : round(360.0 - nDeg);
+}
+
SfxWatermarkItem SwEditShell::GetWatermark()
{
SwDocShell* pDocShell = GetDoc()->GetDocShell();
@@ -311,13 +334,7 @@ SfxWatermarkItem SwEditShell::GetWatermark()
if (xPropertySet->getPropertyValue(UNO_NAME_FILLCOLOR) >>= nColor)
aItem.SetColor(nColor);
if (xPropertySet->getPropertyValue("Transformation") >>= aMatrix)
- {
- double y = aMatrix.Line2.Column1;
- double x = aMatrix.Line1.Column1;
- double nRad = atan2(y, x) * -1;
- double nDeg = nRad * 180.0 / F_PI;
- aItem.SetAngle(nDeg);
- }
+ aItem.SetAngle(lcl_GetAngle(aMatrix));
if (xPropertySet->getPropertyValue(UNO_NAME_FILL_TRANSPARENCE) >>= nTransparency)
aItem.SetTransparency(nTransparency);
@@ -374,10 +391,7 @@ void SwEditShell::SetWatermark(const SfxWatermarkItem& rWatermark)
xPropertySet->getPropertyValue(UNO_NAME_FILLCOLOR) >>= nColor;
xPropertySet->getPropertyValue(UNO_NAME_FILL_TRANSPARENCE) >>= nTransparency;
xPropertySet->getPropertyValue("Transformation") >>= aMatrix;
- double y = aMatrix.Line2.Column1;
- double x = aMatrix.Line1.Column1;
- double nRad = atan2(y, x) * -1;
- nAngle = nRad * 180.0 / F_PI;
+ nAngle = lcl_GetAngle(aMatrix);
// If the header already contains a watermark, see if it its text is up to date.
uno::Reference<text::XTextRange> xTextRange(xWatermark, uno::UNO_QUERY);
--
cgit v0.10.2

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Tue Jun 13 13:46:31 UTC 2017 - tchvatal@suse.com
- Add patch to fix bsc#1028504:
* 0001-undo-clone.patch
- Add patch to fix test failure on 32bit:
* 0001-watermark.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Jun 8 14:04:07 UTC 2017 - tchvatal@suse.com Thu Jun 8 14:04:07 UTC 2017 - tchvatal@suse.com

View File

@ -80,6 +80,9 @@ Patch4: nlpsolver-no-broken-help.diff
Patch5: mediawiki-no-broken-help.diff Patch5: mediawiki-no-broken-help.diff
# PATCH-HOTFIX-UPSTREAM: disable test that rounds wrongly on most archs # PATCH-HOTFIX-UPSTREAM: disable test that rounds wrongly on most archs
Patch16: libreoffice-hotfix-disablebrokenshapetest.patch Patch16: libreoffice-hotfix-disablebrokenshapetest.patch
# PATCH-FIX-UPSTREAM taken from git will be in next release
Patch17: 0001-undo-clone.patch
Patch18: 0001-watermark.patch
# try to save space by using hardlinks # try to save space by using hardlinks
Patch990: install-with-hardlinks.diff Patch990: install-with-hardlinks.diff
BuildRequires: %{name}-share-linker BuildRequires: %{name}-share-linker
@ -939,6 +942,8 @@ Provides additional %{langname} translations and resources for %{project}. \
%patch4 %patch4
%patch5 %patch5
%patch16 -p1 %patch16 -p1
%patch17 -p1
%patch18 -p1
%patch990 -p1 %patch990 -p1
# Do not generate doxygen timestamp # Do not generate doxygen timestamp