Kaydet (Commit) c55d29bd authored tarafından Armin Le Grand's avatar Armin Le Grand

i124389 correct TextFrame layout for tables not when new text is set, but in…

i124389 correct TextFrame layout for tables not when new text is set, but in UNdo/Redo directly for performance reasons
üst 5fb2c24b
......@@ -63,7 +63,6 @@
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <vcl/virdev.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <svx/svdotable.hxx>
//////////////////////////////////////////////////////////////////////////////
......@@ -1501,11 +1500,8 @@ void SdrTextObj::NbcSetOutlinerParaObjectForText( OutlinerParaObject* pTextObjec
}
SetTextSizeDirty();
// #124389# also need to call NbcAdjustTextFrameWidthAndHeight when we are a table object (triggered from undo)
if((IsTextFrame() || 0 != dynamic_cast< sdr::table::SdrTableObj* >(this)) && (IsAutoGrowHeight() || IsAutoGrowWidth()))
{
// adapt text frame
if (IsTextFrame() && (IsAutoGrowHeight() || IsAutoGrowWidth()))
{ // Textrahmen anpassen!
NbcAdjustTextFrameWidthAndHeight();
}
if (!IsTextFrame())
......
......@@ -46,6 +46,9 @@
#include <svx/svdograf.hxx>
#include <svx/sdr/contact/viewcontactofgraphic.hxx>
// #124389#
#include <svx/svdotable.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
// iterates over all views and unmarks this SdrObject if it is marked
......@@ -1187,49 +1190,92 @@ void SdrUndoObjSetText::AfterSetText()
void SdrUndoObjSetText::Undo()
{
// only works with SdrTextObj
SdrTextObj* pTarget = dynamic_cast< SdrTextObj* >(pObj);
if(!pTarget)
{
OSL_ENSURE(false, "SdrUndoObjSetText::Undo with SdrObject not based on SdrTextObj (!)");
return;
}
// #94278# Trigger PageChangeCall
ImpShowPageOfThisObject();
// alten Text sichern fuer Redo
if (!bNewTextAvailable)
if(!bNewTextAvailable)
{
AfterSetText();
}
// Text fuer Undo kopieren, denn SetOutlinerParaObject() ist Eigentumsuebereignung
OutlinerParaObject* pText1 = pOldText;
if(pText1)
{
pText1 = new OutlinerParaObject(*pText1);
}
SdrText* pText = static_cast< SdrTextObj*>( pObj )->getText(mnText);
if( pText )
static_cast< SdrTextObj* >( pObj )->NbcSetOutlinerParaObjectForText( pText1, pText );
SdrText* pText = pTarget->getText(mnText);
pObj->SetEmptyPresObj( bEmptyPresObj );
pObj->ActionChanged();
if(pText)
{
pTarget->NbcSetOutlinerParaObjectForText(pText1, pText);
}
pTarget->SetEmptyPresObj(bEmptyPresObj);
pTarget->ActionChanged();
// #124389# if it's a table, als oneed to relayout TextFrame
if(0 != dynamic_cast< sdr::table::SdrTableObj* >(pTarget))
{
pTarget->NbcAdjustTextFrameWidthAndHeight();
}
// #122410# SetOutlinerParaObject at SdrText does not trigger a
// BroadcastObjectChange, but it is needed to make evtl. SlideSorters
// update their preview.
pObj->BroadcastObjectChange();
pTarget->BroadcastObjectChange();
}
void SdrUndoObjSetText::Redo()
{
// only works with SdrTextObj
SdrTextObj* pTarget = dynamic_cast< SdrTextObj* >(pObj);
if(!pTarget)
{
OSL_ENSURE(false, "SdrUndoObjSetText::Redo with SdrObject not based on SdrTextObj (!)");
return;
}
// Text fuer Undo kopieren, denn SetOutlinerParaObject() ist Eigentumsuebereignung
OutlinerParaObject* pText1 = pNewText;
if(pText1)
{
pText1 = new OutlinerParaObject(*pText1);
}
SdrText* pText = pTarget->getText(mnText);
SdrText* pText = static_cast< SdrTextObj*>( pObj )->getText(mnText);
if( pText )
static_cast< SdrTextObj* >( pObj )->NbcSetOutlinerParaObjectForText( pText1, pText );
if(pText)
{
pTarget->NbcSetOutlinerParaObjectForText(pText1, pText);
}
pObj->ActionChanged();
pTarget->ActionChanged();
// #124389# if it's a table, als oneed to relayout TextFrame
if(0 != dynamic_cast< sdr::table::SdrTableObj* >(pTarget))
{
pTarget->NbcAdjustTextFrameWidthAndHeight();
}
// #122410# NbcSetOutlinerParaObjectForText at SdrTextObj does not trigger a
// BroadcastObjectChange, but it is needed to make evtl. SlideSorters
// update their preview.
pObj->BroadcastObjectChange();
pTarget->BroadcastObjectChange();
// #94278# Trigger PageChangeCall
ImpShowPageOfThisObject();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment