[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - svx/source
Tamás Zolnai
tamas.zolnai at collabora.com
Tue Jun 13 13:57:23 UTC 2017
svx/source/svdraw/svdedxv.cxx | 9 ++++-----
svx/source/table/svdotable.cxx | 19 ++++++++++---------
2 files changed, 14 insertions(+), 14 deletions(-)
New commits:
commit 2108184fa798f16269968b32270e4be625200a3b
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
Date: Mon Jun 12 14:34:59 2017 +0200
tdf#108480: Undo from clone formating does not remove vertical alignment
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.
Reviewed-on: https://gerrit.libreoffice.org/38699
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
(cherry picked from commit 37d8ac12902506f4185e10f1de4f566dbaf53e42)
Change-Id: I3a6a95fac711056a658a3dee616733939cd13330
Reviewed-on: https://gerrit.libreoffice.org/38723
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Jenkins <ci at libreoffice.org>
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 9a55be46c27e..48aac31ef88f 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -2236,9 +2236,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);
}
}
}
@@ -2385,8 +2384,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, false/*bClearAllItems*/);
+ 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 d53ddfffd777..dc5b6cad46bd 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -1774,18 +1774,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();
More information about the Libreoffice-commits
mailing list