Accepting request 394568 from LibreOffice:5.1
- fix bnc#939998 - LO-L3: PPT file shows wrong titles * bnc939998.patch - fix bnc#945443 - LO-L3: Undo ignores vertical alignment * bnc945443.patch - fix bnc#945445 - LO-L3: Undo does not revert changes of table separation lines * bnc945445.patch OBS-URL: https://build.opensuse.org/request/show/394568 OBS-URL: https://build.opensuse.org/package/show/LibreOffice:Factory/libreoffice?expand=0&rev=405
This commit is contained in:
parent
d352b6fafe
commit
a720cfc297
96
bnc939998.patch
Normal file
96
bnc939998.patch
Normal file
@ -0,0 +1,96 @@
|
||||
From 940b21a87cffffca0985c33e9ebb78ddf3aa0c3b Mon Sep 17 00:00:00 2001
|
||||
From: Mike Kaganski <mike.kaganski@collabora.com>
|
||||
Date: Wed, 13 Apr 2016 20:07:52 +1000
|
||||
Subject: [PATCH] tdf#93124: Fix incorrect text fit in imported PPT - take two
|
||||
|
||||
This patch just fixes incorrect decision when the block alignment must
|
||||
be applied.
|
||||
|
||||
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
|
||||
index 437207f..7ac251c 100644
|
||||
--- a/filter/source/msfilter/svdfppt.cxx
|
||||
+++ b/filter/source/msfilter/svdfppt.cxx
|
||||
@@ -893,7 +893,6 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
|
||||
eTHA = SDRTEXTHORZADJUST_LEFT;
|
||||
break;
|
||||
}
|
||||
- // if there is a 100% use of following attributes, the textbox can been aligned also in vertical direction
|
||||
switch ( eTextAnchor )
|
||||
{
|
||||
case mso_anchorTopCentered :
|
||||
@@ -903,20 +902,20 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
|
||||
case mso_anchorBottomCenteredBaseline:
|
||||
{
|
||||
// check if it is sensible to use the centered alignment
|
||||
- sal_uInt32 nMask = PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT | PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT;
|
||||
- if ( ( nTextFlags & nMask ) != nMask ) // if the textobject has left and also right aligned pararagraphs
|
||||
- eTVA = SDRTEXTVERTADJUST_CENTER; // the text has to be displayed using the full width;
|
||||
- }
|
||||
- break;
|
||||
-
|
||||
- default :
|
||||
- {
|
||||
- if ( nTextFlags == PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT )
|
||||
- eTVA = SDRTEXTVERTADJUST_TOP;
|
||||
- else if ( nTextFlags == PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT )
|
||||
- eTVA = SDRTEXTVERTADJUST_BOTTOM;
|
||||
+ const sal_uInt32 nMask = PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT | PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_CENTER | PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT | PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_BLOCK;
|
||||
+ switch (nTextFlags & nMask)
|
||||
+ {
|
||||
+ case PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT:
|
||||
+ case PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_CENTER:
|
||||
+ case PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT:
|
||||
+ case PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_BLOCK:
|
||||
+ eTVA = SDRTEXTVERTADJUST_CENTER; // If the textobject has only one type of alignment, then the text has not to be displayed using the full width;
|
||||
+ break;
|
||||
+ }
|
||||
+ break;
|
||||
}
|
||||
- break;
|
||||
+ default:
|
||||
+ break;
|
||||
}
|
||||
nMinFrameWidth = rTextRect.GetWidth() - ( nTextLeft + nTextRight );
|
||||
}
|
||||
@@ -949,7 +948,6 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
|
||||
eTVA = SDRTEXTVERTADJUST_BOTTOM;
|
||||
break;
|
||||
}
|
||||
- // if there is a 100% usage of following attributes, the textbox can be aligned also in horizontal direction
|
||||
switch ( eTextAnchor )
|
||||
{
|
||||
case mso_anchorTopCentered :
|
||||
@@ -959,20 +957,20 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
|
||||
case mso_anchorBottomCenteredBaseline:
|
||||
{
|
||||
// check if it is sensible to use the centered alignment
|
||||
- sal_uInt32 nMask = PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT | PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT;
|
||||
- if ( ( nTextFlags & nMask ) != nMask ) // if the textobject has left and also right aligned pararagraphs
|
||||
- eTHA = SDRTEXTHORZADJUST_CENTER; // the text has to be displayed using the full width;
|
||||
- }
|
||||
- break;
|
||||
-
|
||||
- default :
|
||||
- {
|
||||
- if ( nTextFlags == PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT )
|
||||
- eTHA = SDRTEXTHORZADJUST_LEFT;
|
||||
- else if ( nTextFlags == PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT )
|
||||
- eTHA = SDRTEXTHORZADJUST_RIGHT;
|
||||
+ const sal_uInt32 nMask = PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT | PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_CENTER | PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT | PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_BLOCK;
|
||||
+ switch (nTextFlags & nMask)
|
||||
+ {
|
||||
+ case PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT:
|
||||
+ case PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_CENTER:
|
||||
+ case PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT:
|
||||
+ case PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_BLOCK:
|
||||
+ eTHA = SDRTEXTHORZADJUST_CENTER; // If the textobject has only one type of alignment, then the text has not to be displayed using the full width;
|
||||
+ break;
|
||||
+ }
|
||||
+ break;
|
||||
}
|
||||
- break;
|
||||
+ default:
|
||||
+ break;
|
||||
}
|
||||
nMinFrameHeight = rTextRect.GetHeight() - ( nTextTop + nTextBottom );
|
||||
}
|
187
bnc945443.patch
Normal file
187
bnc945443.patch
Normal file
@ -0,0 +1,187 @@
|
||||
From 64b2f209b72c5a5662afcb0ac1706b882e0e059b Mon Sep 17 00:00:00 2001
|
||||
From: Miklos Vajna <vmiklos@collabora.co.uk>
|
||||
Date: Tue, 19 Apr 2016 17:38:14 +0200
|
||||
Subject: [PATCH] tdf#99396 SvxTableController::SetVertical: implement undo
|
||||
support
|
||||
|
||||
All the table and cell objects know how to undo this change, what was
|
||||
missing is the begin/end undo calls and the broadcast of the cell
|
||||
format change.
|
||||
|
||||
(cherry picked from commits 3057b5cdb989d44613518900b25ebad8b7c600a2,
|
||||
d60d70d92cec7bbc471f8f0c653d443282227d34,
|
||||
6819992113947e7a6272bf750fee712c2df41905 and
|
||||
100eb15b4d8529d7a11d98a28742f31f0f792fa1)
|
||||
|
||||
Conflicts:
|
||||
sd/qa/unit/misc-tests.cxx
|
||||
|
||||
Change-Id: I3dfd203faf5c579da2937fedab5647129a8e903a
|
||||
Reviewed-on: https://gerrit.libreoffice.org/24276
|
||||
Tested-by: Jenkins <ci@libreoffice.org>
|
||||
Reviewed-by: Andras Timar <andras.timar@collabora.com>
|
||||
---
|
||||
include/svx/svdotable.hxx | 4 ++
|
||||
sd/inc/drawdoc.hxx | 2 +-
|
||||
sd/qa/unit/data/tdf99396.odp | Bin 0 -> 10956 bytes
|
||||
sd/qa/unit/misc-tests.cxx | 104 +++++++++++++++++++++++++++++++++
|
||||
sd/source/ui/table/TableDesignPane.cxx | 10 +++-
|
||||
svx/source/table/cell.cxx | 5 ++
|
||||
svx/source/table/svdotable.cxx | 12 ++++
|
||||
svx/source/table/tablecontroller.cxx | 18 +++++-
|
||||
8 files changed, 152 insertions(+), 3 deletions(-)
|
||||
create mode 100644 sd/qa/unit/data/tdf99396.odp
|
||||
|
||||
diff --git a/include/svx/svdotable.hxx b/include/svx/svdotable.hxx
|
||||
index 78a7e53c..f70d768 100644
|
||||
--- a/include/svx/svdotable.hxx
|
||||
+++ b/include/svx/svdotable.hxx
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
class SvStream;
|
||||
class SfxStyleSheet;
|
||||
+class SdrUndoAction;
|
||||
|
||||
namespace sdr { namespace contact {
|
||||
class ViewContactOfTableObj;
|
||||
@@ -257,6 +258,9 @@ public:
|
||||
|
||||
css::text::WritingMode GetWritingMode() const;
|
||||
|
||||
+ /// Add an undo action that should be on the undo stack after ending text edit.
|
||||
+ void AddUndo(SdrUndoAction* pUndo);
|
||||
+
|
||||
virtual void onEditOutlinerStatusEvent( EditStatus* pEditStatus ) override;
|
||||
|
||||
|
||||
diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
|
||||
index e2ff20c..ee8a876 100644
|
||||
--- a/sd/inc/drawdoc.hxx
|
||||
+++ b/sd/inc/drawdoc.hxx
|
||||
@@ -571,7 +571,7 @@ public:
|
||||
languages set at this document */
|
||||
SAL_DLLPRIVATE void getDefaultFonts( vcl::Font& rLatinFont, vcl::Font& rCJKFont, vcl::Font& rCTLFont );
|
||||
|
||||
- SAL_DLLPRIVATE sd::UndoManager* GetUndoManager() const;
|
||||
+ sd::UndoManager* GetUndoManager() const;
|
||||
|
||||
/** converts the given western font height to a corresponding ctl font height, depending on the system language */
|
||||
SAL_DLLPRIVATE static sal_uInt32 convertFontHeightToCTL( sal_uInt32 nWesternFontHeight );
|
||||
diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx
|
||||
index 2bd52b5..4ae2e1d 100644
|
||||
--- a/sd/source/ui/table/TableDesignPane.cxx
|
||||
+++ b/sd/source/ui/table/TableDesignPane.cxx
|
||||
@@ -806,7 +806,15 @@ short TableDesignDialog::Execute()
|
||||
|
||||
VclPtr<vcl::Window> createTableDesignPanel( vcl::Window* pParent, ViewShellBase& rBase )
|
||||
{
|
||||
- return VclPtr<TableDesignPane>::Create( pParent, rBase );
|
||||
+ VclPtr<TableDesignPane> pRet = nullptr;
|
||||
+ try
|
||||
+ {
|
||||
+ pRet = VclPtr<TableDesignPane>::Create( pParent, rBase );
|
||||
+ }
|
||||
+ catch (const uno::Exception&)
|
||||
+ {
|
||||
+ }
|
||||
+ return pRet;
|
||||
}
|
||||
|
||||
void showTableDesignDialog( vcl::Window* pParent, ViewShellBase& rBase )
|
||||
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
|
||||
index b2d1604..c783cb1 100644
|
||||
--- a/svx/source/table/cell.cxx
|
||||
+++ b/svx/source/table/cell.cxx
|
||||
@@ -799,6 +799,11 @@ void Cell::AddUndo()
|
||||
{
|
||||
CellRef xCell( this );
|
||||
GetModel()->AddUndo( new CellUndo( &rObj, xCell ) );
|
||||
+
|
||||
+ // Undo action for the after-text-edit-ended stack.
|
||||
+ SdrTableObj* pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(&rObj);
|
||||
+ if (pTableObj && pTableObj->IsTextEditActive())
|
||||
+ pTableObj->AddUndo(new CellUndo(pTableObj, xCell));
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
|
||||
index 15bbb7f..5b979fe 100644
|
||||
--- a/svx/source/table/svdotable.cxx
|
||||
+++ b/svx/source/table/svdotable.cxx
|
||||
@@ -205,6 +205,7 @@ public:
|
||||
CellPos maEditPos;
|
||||
TableStyleSettings maTableStyle;
|
||||
Reference< XIndexAccess > mxTableStyle;
|
||||
+ std::vector<std::unique_ptr<SdrUndoAction>> maUndos;
|
||||
|
||||
void SetModel(SdrModel* pOldModel, SdrModel* pNewModel);
|
||||
|
||||
@@ -1860,7 +1861,14 @@ void SdrTableObj::EndTextEdit(SdrOutliner& rOutl)
|
||||
if(rOutl.IsModified())
|
||||
{
|
||||
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();
|
||||
+
|
||||
GetModel()->AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*this) );
|
||||
+ }
|
||||
|
||||
OutlinerParaObject* pNewText = nullptr;
|
||||
Paragraph* p1stPara = rOutl.GetParagraph( 0 );
|
||||
@@ -2085,6 +2093,10 @@ WritingMode SdrTableObj::GetWritingMode() const
|
||||
return eWritingMode;
|
||||
}
|
||||
|
||||
+void SdrTableObj::AddUndo(SdrUndoAction* pUndo)
|
||||
+{
|
||||
+ mpImpl->maUndos.push_back(std::unique_ptr<SdrUndoAction>(pUndo));
|
||||
+}
|
||||
|
||||
|
||||
// gets base transformation and rectangle of object. If it's an SdrPathObj it fills the PolyPolygon
|
||||
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
|
||||
index 0238e85..beb75e0 100644
|
||||
--- a/svx/source/table/tablecontroller.cxx
|
||||
+++ b/svx/source/table/tablecontroller.cxx
|
||||
@@ -1177,6 +1177,13 @@ void SvxTableController::SetVertical( sal_uInt16 nSId )
|
||||
{
|
||||
TableModelNotifyGuard aGuard( mxTable.get() );
|
||||
|
||||
+ bool bUndo = mpModel && mpModel->IsUndoEnabled();
|
||||
+ if (bUndo)
|
||||
+ {
|
||||
+ mpModel->BegUndo(ImpGetResStr(STR_TABLE_NUMFORMAT));
|
||||
+ mpModel->AddUndo(mpModel->GetSdrUndoFactory().CreateUndoAttrObject(*pTableObj));
|
||||
+ }
|
||||
+
|
||||
CellPos aStart, aEnd;
|
||||
getSelectedCells( aStart, aEnd );
|
||||
|
||||
@@ -1203,11 +1210,20 @@ void SvxTableController::SetVertical( sal_uInt16 nSId )
|
||||
{
|
||||
CellRef xCell( dynamic_cast< Cell* >( mxTable->getCellByPosition( nCol, nRow ).get() ) );
|
||||
if( xCell.is() )
|
||||
- xCell->SetMergedItem(aItem);
|
||||
+ {
|
||||
+ if (bUndo)
|
||||
+ xCell->AddUndo();
|
||||
+ SfxItemSet aSet(xCell->GetItemSet());
|
||||
+ aSet.Put(aItem);
|
||||
+ xCell->SetMergedItemSetAndBroadcast(aSet, /*bClearAllItems=*/false);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
UpdateTableShape();
|
||||
+
|
||||
+ if (bUndo)
|
||||
+ mpModel->EndUndo();
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.6.6
|
||||
|
276
bnc945445.patch
Normal file
276
bnc945445.patch
Normal file
@ -0,0 +1,276 @@
|
||||
From 5c32e526d7cc1f623ca1b60a16537efa5740dd6c Mon Sep 17 00:00:00 2001
|
||||
From: Miklos Vajna <vmiklos@collabora.co.uk>
|
||||
Date: Mon, 25 Apr 2016 10:57:49 +0200
|
||||
Subject: [PATCH] tdf#99452 svx: fix undo of table row edge drag
|
||||
|
||||
The problem as seen by the user: if you have a table of 2 rows and 1 column,
|
||||
and the separator line is dragged upwards by the mouse, then undo doesn't
|
||||
restore the original situation.
|
||||
|
||||
Two items are created on the undo stack: sd::UndoGeoObject and
|
||||
sdr::table::TableRowUndo. Let's say the table height is 8000 mm100 and the two
|
||||
cell heights are 4000 and 4000. If the user resizes the first cell, so that its
|
||||
height is 2000, then the new table height will be 6000. The problem is that
|
||||
when undo is executed, first sd::UndoGeoObject resizes the table, distributing
|
||||
the newly available 2000 between the existing rows, and then
|
||||
sdr::table::TableRowUndo sets the row height of the first row: the height of
|
||||
the second cell will be larger than expected. Fix the problem by not doing a
|
||||
relayout during sd::UndoGeoObject, but doing a relayout after
|
||||
sdr::table::TableRowUndo in this case.
|
||||
|
||||
This is done by:
|
||||
|
||||
1) Adding a new SdrDragStat::mbEndDragChangesLayout, so that
|
||||
SdrTableObj::applySpecialDrag() can inform SdrDragObjOwn::EndSdrDrag() that
|
||||
TableRowUndo will do the layout instead of UndoGeoObject. (This is done only in
|
||||
case a row edge is dragged, as otherwise it's not guaranteed that a
|
||||
TableRowUndo will follow the UndoGeoObject on the undo stack.)
|
||||
|
||||
2) Adding a new SdrUndoGeoObj::mbSkipChangeLayout, so that
|
||||
SdrTableObj::applySpecialDrag() can let SdrUndoGeoObj::Undo() not do the
|
||||
layout.
|
||||
|
||||
3) Adding a sdr::table::SdrTableObjImpl::mbSkipChangeLayout, so that
|
||||
SdrUndoGeoObj::Undo() can let SdrTableObj::NbcSetLogicRect() not do the layout.
|
||||
|
||||
4) Marking the table model as modified in TableRowUndo::setData(), so it does
|
||||
the layout at the end of the undo group.
|
||||
|
||||
(cherry picked from commits cafc53f8b4c08443524b1da6f4918d49afd45bb5,
|
||||
8d1fa417bc49a9e9eee923e3ce6a37d7b0f056f1 and
|
||||
758e6f39d96237881198818e3bac432012be61d8)
|
||||
|
||||
Conflicts:
|
||||
sd/qa/unit/tiledrendering/tiledrendering.cxx
|
||||
svx/source/table/svdotable.cxx
|
||||
|
||||
Change-Id: I8adde3cdad5741e6fcb420e333ce336e18c77cf1
|
||||
Reviewed-on: https://gerrit.libreoffice.org/24392
|
||||
Tested-by: Jenkins <ci@libreoffice.org>
|
||||
Reviewed-by: Andras Timar <andras.timar@collabora.com>
|
||||
---
|
||||
include/svx/svddrag.hxx | 4 +++
|
||||
include/svx/svdotable.hxx | 3 ++
|
||||
include/svx/svdundo.hxx | 3 ++
|
||||
sd/qa/unit/tiledrendering/data/table.odp | Bin 0 -> 10559 bytes
|
||||
sd/qa/unit/tiledrendering/tiledrendering.cxx | 52 +++++++++++++++++++++++++++
|
||||
svx/source/svdraw/svddrag.cxx | 1 +
|
||||
svx/source/svdraw/svddrgmt.cxx | 6 ++++
|
||||
svx/source/svdraw/svdundo.cxx | 7 ++++
|
||||
svx/source/table/svdotable.cxx | 14 +++++++-
|
||||
svx/source/table/tablerow.cxx | 4 +++
|
||||
svx/source/table/tablerow.hxx | 2 ++
|
||||
svx/source/table/tableundo.cxx | 3 ++
|
||||
12 files changed, 98 insertions(+), 1 deletion(-)
|
||||
create mode 100644 sd/qa/unit/tiledrendering/data/table.odp
|
||||
|
||||
diff --git a/include/svx/svddrag.hxx b/include/svx/svddrag.hxx
|
||||
index ac2a978..aa4a03e 100644
|
||||
--- a/include/svx/svddrag.hxx
|
||||
+++ b/include/svx/svddrag.hxx
|
||||
@@ -55,6 +55,8 @@ protected:
|
||||
|
||||
bool bEndDragChangesAttributes;
|
||||
bool bEndDragChangesGeoAndAttributes;
|
||||
+ /// Table row drag: table will re-layout itself later.
|
||||
+ bool mbEndDragChangesLayout;
|
||||
bool bMouseIsUp;
|
||||
|
||||
bool bShown; // Xor visible?
|
||||
@@ -133,6 +135,8 @@ public:
|
||||
void SetEndDragChangesAttributes(bool bOn) { bEndDragChangesAttributes=bOn; }
|
||||
bool IsEndDragChangesGeoAndAttributes() const { return bEndDragChangesGeoAndAttributes; }
|
||||
void SetEndDragChangesGeoAndAttributes(bool bOn) { bEndDragChangesGeoAndAttributes=bOn; }
|
||||
+ bool IsEndDragChangesLayout() const { return mbEndDragChangesLayout; }
|
||||
+ void SetEndDragChangesLayout(bool bOn) { mbEndDragChangesLayout=bOn; }
|
||||
|
||||
// Is set by the view and can be evaluated by Obj
|
||||
bool IsMouseDown() const { return !bMouseIsUp; }
|
||||
diff --git a/include/svx/svdotable.hxx b/include/svx/svdotable.hxx
|
||||
index f70d768..408f0b8 100644
|
||||
--- a/include/svx/svdotable.hxx
|
||||
+++ b/include/svx/svdotable.hxx
|
||||
@@ -261,6 +261,9 @@ public:
|
||||
/// Add an undo action that should be on the undo stack after ending text edit.
|
||||
void AddUndo(SdrUndoAction* pUndo);
|
||||
|
||||
+ /// Next time layouting would be done, skip it (to layout at the end of multiple actions).
|
||||
+ void SetSkipChangeLayout(bool bSkipChangeLayout);
|
||||
+
|
||||
virtual void onEditOutlinerStatusEvent( EditStatus* pEditStatus ) override;
|
||||
|
||||
|
||||
diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx
|
||||
index 966e408..7d4973f 100644
|
||||
--- a/include/svx/svdundo.hxx
|
||||
+++ b/include/svx/svdundo.hxx
|
||||
@@ -213,6 +213,8 @@ protected:
|
||||
SdrObjGeoData* pRedoGeo;
|
||||
// If we have a group object:
|
||||
SdrUndoGroup* pUndoGroup;
|
||||
+ /// If we have a table object, should its layout change?
|
||||
+ bool mbSkipChangeLayout;
|
||||
|
||||
public:
|
||||
SdrUndoGeoObj(SdrObject& rNewObj);
|
||||
@@ -222,6 +224,7 @@ public:
|
||||
virtual void Redo() override;
|
||||
|
||||
virtual OUString GetComment() const override;
|
||||
+ void SetSkipChangeLayout(bool bOn) { mbSkipChangeLayout=bOn; }
|
||||
};
|
||||
|
||||
/**
|
||||
diff --git a/svx/source/svdraw/svddrag.cxx b/svx/source/svdraw/svddrag.cxx
|
||||
index 91cd2d1..2f44f47 100644
|
||||
--- a/svx/source/svdraw/svddrag.cxx
|
||||
+++ b/svx/source/svdraw/svddrag.cxx
|
||||
@@ -50,6 +50,7 @@ void SdrDragStat::Reset()
|
||||
pDragMethod=nullptr;
|
||||
bEndDragChangesAttributes=false;
|
||||
bEndDragChangesGeoAndAttributes=false;
|
||||
+ mbEndDragChangesLayout=false;
|
||||
bMouseIsUp=false;
|
||||
Clear(true);
|
||||
aActionRect=Rectangle();
|
||||
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
|
||||
index bff9a6c..9d70c20 100644
|
||||
--- a/svx/source/svdraw/svddrgmt.cxx
|
||||
+++ b/svx/source/svdraw/svddrgmt.cxx
|
||||
@@ -1423,6 +1423,12 @@ bool SdrDragObjOwn::EndSdrDrag(bool /*bCopy*/)
|
||||
}
|
||||
|
||||
bRet = pObj->applySpecialDrag(DragStat());
|
||||
+ if (DragStat().IsEndDragChangesLayout())
|
||||
+ {
|
||||
+ auto pGeoUndo = dynamic_cast<SdrUndoGeoObj*>(pUndo);
|
||||
+ if (pGeoUndo)
|
||||
+ pGeoUndo->SetSkipChangeLayout(true);
|
||||
+ }
|
||||
|
||||
if(bRet)
|
||||
{
|
||||
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
|
||||
index b3cf6ae..9567d9e 100644
|
||||
--- a/svx/source/svdraw/svdundo.cxx
|
||||
+++ b/svx/source/svdraw/svdundo.cxx
|
||||
@@ -603,6 +603,7 @@ SdrUndoGeoObj::SdrUndoGeoObj(SdrObject& rNewObj)
|
||||
, pUndoGeo(nullptr)
|
||||
, pRedoGeo(nullptr)
|
||||
, pUndoGroup(nullptr)
|
||||
+ , mbSkipChangeLayout(false)
|
||||
{
|
||||
SdrObjList* pOL=rNewObj.GetSubList();
|
||||
if (pOL!=nullptr && pOL->GetObjCount() && dynamic_cast<const E3dScene* >( &rNewObj) == nullptr)
|
||||
@@ -645,7 +646,13 @@ void SdrUndoGeoObj::Undo()
|
||||
{
|
||||
delete pRedoGeo;
|
||||
pRedoGeo=pObj->GetGeoData();
|
||||
+
|
||||
+ auto pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pObj);
|
||||
+ if (pTableObj && mbSkipChangeLayout)
|
||||
+ pTableObj->SetSkipChangeLayout(true);
|
||||
pObj->SetGeoData(*pUndoGeo);
|
||||
+ if (pTableObj && mbSkipChangeLayout && pTableObj)
|
||||
+ pTableObj->SetSkipChangeLayout(false);
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
|
||||
index 5b979fe..4fbcb1f 100644
|
||||
--- a/svx/source/table/svdotable.cxx
|
||||
+++ b/svx/source/table/svdotable.cxx
|
||||
@@ -206,6 +206,7 @@ public:
|
||||
TableStyleSettings maTableStyle;
|
||||
Reference< XIndexAccess > mxTableStyle;
|
||||
std::vector<std::unique_ptr<SdrUndoAction>> maUndos;
|
||||
+ bool mbSkipChangeLayout;
|
||||
|
||||
void SetModel(SdrModel* pOldModel, SdrModel* pNewModel);
|
||||
|
||||
@@ -262,6 +263,7 @@ sal_Int32 SdrTableObjImpl::lastColCount;
|
||||
SdrTableObjImpl::SdrTableObjImpl()
|
||||
: mpTableObj( nullptr )
|
||||
, mpLayouter( nullptr )
|
||||
+, mbSkipChangeLayout(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1950,7 +1952,11 @@ void SdrTableObj::NbcSetLogicRect(const Rectangle& rRect)
|
||||
const bool bWidth = maLogicRect.getWidth() != maRect.getWidth();
|
||||
const bool bHeight = maLogicRect.getHeight() != maRect.getHeight();
|
||||
maRect = maLogicRect;
|
||||
- NbcAdjustTextFrameWidthAndHeight( !bHeight, !bWidth );
|
||||
+ if (mpImpl->mbSkipChangeLayout)
|
||||
+ // Avoid distributing newly available space between existing cells.
|
||||
+ NbcAdjustTextFrameWidthAndHeight();
|
||||
+ else
|
||||
+ NbcAdjustTextFrameWidthAndHeight(!bHeight, !bWidth);
|
||||
SetRectsDirty();
|
||||
}
|
||||
|
||||
@@ -2098,6 +2104,11 @@ void SdrTableObj::AddUndo(SdrUndoAction* pUndo)
|
||||
mpImpl->maUndos.push_back(std::unique_ptr<SdrUndoAction>(pUndo));
|
||||
}
|
||||
|
||||
+void SdrTableObj::SetSkipChangeLayout(bool bSkipChangeLayout)
|
||||
+{
|
||||
+ mpImpl->mbSkipChangeLayout = bSkipChangeLayout;
|
||||
+}
|
||||
+
|
||||
|
||||
// gets base transformation and rectangle of object. If it's an SdrPathObj it fills the PolyPolygon
|
||||
// with the base geometry and returns TRUE. Otherwise it returns FALSE.
|
||||
@@ -2341,6 +2352,7 @@ bool SdrTableObj::applySpecialDrag(SdrDragStat& rDrag)
|
||||
if( GetModel() && IsInserted() )
|
||||
{
|
||||
rDrag.SetEndDragChangesAttributes(true);
|
||||
+ rDrag.SetEndDragChangesLayout(true);
|
||||
}
|
||||
|
||||
mpImpl->DragEdge( pEdgeHdl->IsHorizontalEdge(), pEdgeHdl->GetPointNum(), pEdgeHdl->GetValidDragOffset( rDrag ) );
|
||||
diff --git a/svx/source/table/tablerow.cxx b/svx/source/table/tablerow.cxx
|
||||
index d86f7e9..37212b7 100644
|
||||
--- a/svx/source/table/tablerow.cxx
|
||||
+++ b/svx/source/table/tablerow.cxx
|
||||
@@ -157,6 +157,10 @@ void TableRow::removeColumns( sal_Int32 nIndex, sal_Int32 nCount )
|
||||
}
|
||||
}
|
||||
|
||||
+TableModelRef const & TableRow::getModel() const
|
||||
+{
|
||||
+ return mxTableModel;
|
||||
+}
|
||||
|
||||
// XCellRange
|
||||
|
||||
diff --git a/svx/source/table/tablerow.hxx b/svx/source/table/tablerow.hxx
|
||||
index cc8c236..5fdd940 100644
|
||||
--- a/svx/source/table/tablerow.hxx
|
||||
+++ b/svx/source/table/tablerow.hxx
|
||||
@@ -48,6 +48,8 @@ public:
|
||||
|
||||
void insertColumns( sal_Int32 nIndex, sal_Int32 nCount, CellVector::iterator* pIter = nullptr );
|
||||
void removeColumns( sal_Int32 nIndex, sal_Int32 nCount );
|
||||
+ /// Reference to the table model containing this row.
|
||||
+ TableModelRef const & getModel() const;
|
||||
|
||||
// XCellRange
|
||||
virtual css::uno::Reference< css::table::XCell > SAL_CALL getCellByPosition( sal_Int32 nColumn, sal_Int32 nRow ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException, std::exception) override;
|
||||
diff --git a/svx/source/table/tableundo.cxx b/svx/source/table/tableundo.cxx
|
||||
index 250675e..59d08a2 100644
|
||||
--- a/svx/source/table/tableundo.cxx
|
||||
+++ b/svx/source/table/tableundo.cxx
|
||||
@@ -492,6 +492,9 @@ void TableRowUndo::setData( const Data& rData )
|
||||
mxRow->mbIsVisible = rData.mbIsVisible;
|
||||
mxRow->mbIsStartOfNewPage = rData.mbIsStartOfNewPage;
|
||||
mxRow->maName = rData.maName;
|
||||
+
|
||||
+ // Trigger re-layout of the table.
|
||||
+ mxRow->getModel()->setModified(true);
|
||||
}
|
||||
|
||||
|
||||
--
|
||||
2.6.6
|
||||
|
@ -1,3 +1,13 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon May 9 20:39:22 UTC 2016 - andras.timar@collabora.com
|
||||
|
||||
- fix bnc#939998 - LO-L3: PPT file shows wrong titles
|
||||
* bnc939998.patch
|
||||
- fix bnc#945443 - LO-L3: Undo ignores vertical alignment
|
||||
* bnc945443.patch
|
||||
- fix bnc#945445 - LO-L3: Undo does not revert changes of table separation lines
|
||||
* bnc945445.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri May 6 13:36:10 UTC 2016 - tchvatal@suse.com
|
||||
|
||||
|
@ -180,6 +180,12 @@ Patch15: 0003-boost-filesystem2.patch
|
||||
Patch16: libreoffice-hotfix-disablebrokenshapetest.patch
|
||||
# bnc#856729 - LO-L3: fix double borders in Calc
|
||||
Patch17: bnc856729.patch
|
||||
# bnc#939998 - LO-L3: PPT file shows wrong titles
|
||||
Patch18: bnc939998.patch
|
||||
# bnc#945443 - LO-L3: Undo ignores vertical alignment
|
||||
Patch19: bnc945443.patch
|
||||
# bnc#945445 - LO-L3: Undo does not revert changes of table separation lines
|
||||
Patch20: bnc945445.patch
|
||||
# try to save space by using hardlinks
|
||||
Patch990: install-with-hardlinks.diff
|
||||
BuildRequires: %{name}-share-linker
|
||||
@ -1085,6 +1091,9 @@ Provides additional %{langname} translations and resources for %{project}. \
|
||||
%patch15 -p1
|
||||
%patch16 -p1
|
||||
%patch17 -p1
|
||||
%patch18 -p1
|
||||
%patch19 -p1
|
||||
%patch20 -p1
|
||||
%patch990 -p1
|
||||
# 256x256 icons
|
||||
tar -xjf %{SOURCE20}
|
||||
|
Loading…
Reference in New Issue
Block a user