summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2017-06-12 14:34:59 +0200
committerTamás Zolnai <tamas.zolnai@collabora.com>2017-06-13 11:38:38 +0200
commitcd38a25d41e1ce2acad25b1b5b2a5e77239e36ed (patch)
tree91ef17073722857724fb1d9fe7554180141b915d /svx
parent1ac550cb9e9379b32853518f9e366e0620ae2f69 (diff)
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. 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
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdedxv.cxx9
-rw-r--r--svx/source/table/svdotable.cxx19
2 files changed, 14 insertions, 14 deletions
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index ff71c07db5bb..ea521d790752 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 4c51d4149465..ef58d32b4a5b 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();