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

#119885# Made EditMode work with text boxes where text is reaching over the TextBox's bounds

üst 75c944ee
...@@ -49,7 +49,6 @@ ...@@ -49,7 +49,6 @@
#include <sot/exchange.hxx> #include <sot/exchange.hxx>
#include <sot/formats.hxx> #include <sot/formats.hxx>
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::linguistic2; using namespace ::com::sun::star::linguistic2;
...@@ -449,65 +448,52 @@ void ImpEditView::SetOutputArea( const Rectangle& rRec ) ...@@ -449,65 +448,52 @@ void ImpEditView::SetOutputArea( const Rectangle& rRec )
void ImpEditView::ResetOutputArea( const Rectangle& rRec ) void ImpEditView::ResetOutputArea( const Rectangle& rRec )
{ {
Rectangle aCurArea( aOutArea ); // remember old out area
SetOutputArea( rRec ); const Rectangle aOldArea(aOutArea);
// Umliegende Bereiche invalidieren, wenn UpdateMode der Engine auf sal_True
if ( !aCurArea.IsEmpty() && pEditEngine->pImpEditEngine->GetUpdateMode() ) // apply new one
SetOutputArea(rRec);
// invalidate surrounding areas if update is true
if(!aOldArea.IsEmpty() && pEditEngine->pImpEditEngine->GetUpdateMode())
{ {
long nMore = 0; // #119885# use grown area if needed; do when getting bigger OR smaller
if ( DoInvalidateMore() ) const sal_Int32 nMore(DoInvalidateMore() ? GetWindow()->PixelToLogic(Size(nInvMore, 0)).Width() : 0);
nMore = GetWindow()->PixelToLogic( Size( nInvMore, 0 ) ).Width();
if ( aCurArea.Left() < aOutArea.Left() ) if(aOldArea.Left() > aOutArea.Left())
{ {
Rectangle aRect( aCurArea.TopLeft(), GetWindow()->Invalidate(Rectangle(aOutArea.Left() - nMore, aOldArea.Top() - nMore, aOldArea.Left(), aOldArea.Bottom() + nMore));
Size( aOutArea.Left()-aCurArea.Left(), aCurArea.GetHeight() ) );
if ( nMore )
{
aRect.Left() -= nMore;
aRect.Top() -= nMore;
aRect.Bottom() += nMore;
}
GetWindow()->Invalidate( aRect );
} }
if ( aCurArea.Right() > aOutArea.Right() ) else if(aOldArea.Left() < aOutArea.Left())
{ {
long nW = aCurArea.Right() - aOutArea.Right(); GetWindow()->Invalidate(Rectangle(aOldArea.Left() - nMore, aOldArea.Top() - nMore, aOutArea.Left(), aOldArea.Bottom() + nMore));
Point aPos( aCurArea.TopRight() );
aPos.X() -= nW;
Rectangle aRect( aPos, Size( nW, aCurArea.GetHeight() ) );
if ( nMore )
{
aRect.Right() += nMore;
aRect.Top() -= nMore;
aRect.Bottom() += nMore;
}
GetWindow()->Invalidate( aRect );
} }
if ( aCurArea.Top() < aOutArea.Top() )
if(aOldArea.Right() > aOutArea.Right())
{ {
Rectangle aRect( aCurArea.TopLeft(), Size( aCurArea.GetWidth(), aOutArea.Top() - aCurArea.Top() ) ); GetWindow()->Invalidate(Rectangle(aOutArea.Right(), aOldArea.Top() - nMore, aOldArea.Right() + nMore, aOldArea.Bottom() + nMore));
if ( nMore )
{
aRect.Top() -= nMore;
aRect.Left() -= nMore;
aRect.Right() += nMore;
}
GetWindow()->Invalidate( aRect );
} }
if ( aCurArea.Bottom() > aOutArea.Bottom() ) else if(aOldArea.Right() < aOutArea.Right())
{ {
long nH = aCurArea.Bottom() - aOutArea.Bottom(); GetWindow()->Invalidate(Rectangle(aOldArea.Right(), aOldArea.Top() - nMore, aOutArea.Right() + nMore, aOldArea.Bottom() + nMore));
Point aPos( aCurArea.BottomLeft() ); }
aPos.Y() -= nH;
Rectangle aRect( aPos, Size( aCurArea.GetWidth(), nH ) );
if ( nMore )
{
aRect.Bottom() += nMore;
aRect.Left() -= nMore;
aRect.Right() += nMore;
}
GetWindow()->Invalidate( aRect ); if(aOldArea.Top() > aOutArea.Top())
{
GetWindow()->Invalidate(Rectangle(aOldArea.Left() - nMore, aOutArea.Top() - nMore, aOldArea.Right() + nMore, aOldArea.Top()));
}
else if(aOldArea.Top() < aOutArea.Top())
{
GetWindow()->Invalidate(Rectangle(aOldArea.Left() - nMore, aOldArea.Top() - nMore, aOldArea.Right() + nMore, aOutArea.Top()));
}
if(aOldArea.Bottom() > aOutArea.Bottom())
{
GetWindow()->Invalidate(Rectangle(aOldArea.Left() - nMore, aOutArea.Bottom(), aOldArea.Right() + nMore, aOldArea.Bottom() + nMore));
}
else if(aOldArea.Bottom() < aOutArea.Bottom())
{
GetWindow()->Invalidate(Rectangle(aOldArea.Left() - nMore, aOldArea.Bottom(), aOldArea.Right() + nMore, aOutArea.Bottom() + nMore));
} }
} }
} }
......
...@@ -211,6 +211,7 @@ void SdrObjEditView::ModelHasChanged() ...@@ -211,6 +211,7 @@ void SdrObjEditView::ModelHasChanged()
aMinArea1.Move(aPvOfs.X(),aPvOfs.Y()); aMinArea1.Move(aPvOfs.X(),aPvOfs.Y());
Rectangle aNewArea(aMinArea1); Rectangle aNewArea(aMinArea1);
aNewArea.Union(aEditArea1); aNewArea.Union(aEditArea1);
if (aNewArea!=aOldArea || aEditArea1!=aTextEditArea || aMinArea1!=aMinTextEditArea || if (aNewArea!=aOldArea || aEditArea1!=aTextEditArea || aMinArea1!=aMinTextEditArea ||
pTextEditOutliner->GetMinAutoPaperSize()!=aPaperMin1 || pTextEditOutliner->GetMaxAutoPaperSize()!=aPaperMax1) { pTextEditOutliner->GetMinAutoPaperSize()!=aPaperMin1 || pTextEditOutliner->GetMaxAutoPaperSize()!=aPaperMax1) {
aTextEditArea=aEditArea1; aTextEditArea=aEditArea1;
......
...@@ -862,6 +862,17 @@ void SdrTextObj::TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, FAS ...@@ -862,6 +862,17 @@ void SdrTextObj::TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, FAS
if (eAniDirection==SDRTEXTANI_LEFT || eAniDirection==SDRTEXTANI_RIGHT) nWdt=1000000; if (eAniDirection==SDRTEXTANI_LEFT || eAniDirection==SDRTEXTANI_RIGHT) nWdt=1000000;
if (eAniDirection==SDRTEXTANI_UP || eAniDirection==SDRTEXTANI_DOWN) nHgt=1000000; if (eAniDirection==SDRTEXTANI_UP || eAniDirection==SDRTEXTANI_DOWN) nHgt=1000000;
} }
// #119885# Do not limit/force height to geometrical frame (vice versa for vertical writing)
if(IsVerticalWriting())
{
nWdt = 1000000;
}
else
{
nHgt = 1000000;
}
rOutliner.SetMaxAutoPaperSize(Size(nWdt,nHgt)); rOutliner.SetMaxAutoPaperSize(Size(nWdt,nHgt));
} }
......
...@@ -180,8 +180,19 @@ void SdrTextObj::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* p ...@@ -180,8 +180,19 @@ void SdrTextObj::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* p
if (!bFitToSize) { if (!bFitToSize) {
if (nMaxWdt==0 || nMaxWdt>aMaxSiz.Width()) nMaxWdt=aMaxSiz.Width(); if (nMaxWdt==0 || nMaxWdt>aMaxSiz.Width()) nMaxWdt=aMaxSiz.Width();
if (nMaxHgt==0 || nMaxHgt>aMaxSiz.Height()) nMaxHgt=aMaxSiz.Height(); if (nMaxHgt==0 || nMaxHgt>aMaxSiz.Height()) nMaxHgt=aMaxSiz.Height();
if (!IsAutoGrowWidth() ) { nMaxWdt=aAnkSiz.Width(); nMinWdt=nMaxWdt; }
if (!IsAutoGrowHeight()) { nMaxHgt=aAnkSiz.Height(); nMinHgt=nMaxHgt; } if (!IsAutoGrowWidth() )
{
nMinWdt = aAnkSiz.Width();
nMaxWdt = nMinWdt;
}
if (!IsAutoGrowHeight())
{
nMinHgt = aAnkSiz.Height();
nMaxHgt = nMinHgt;
}
SdrTextAniKind eAniKind=GetTextAniKind(); SdrTextAniKind eAniKind=GetTextAniKind();
SdrTextAniDirection eAniDirection=GetTextAniDirection(); SdrTextAniDirection eAniDirection=GetTextAniDirection();
...@@ -194,9 +205,22 @@ void SdrTextObj::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* p ...@@ -194,9 +205,22 @@ void SdrTextObj::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* p
if (eAniDirection==SDRTEXTANI_LEFT || eAniDirection==SDRTEXTANI_RIGHT) nMaxWdt=1000000; if (eAniDirection==SDRTEXTANI_LEFT || eAniDirection==SDRTEXTANI_RIGHT) nMaxWdt=1000000;
if (eAniDirection==SDRTEXTANI_UP || eAniDirection==SDRTEXTANI_DOWN) nMaxHgt=1000000; if (eAniDirection==SDRTEXTANI_UP || eAniDirection==SDRTEXTANI_DOWN) nMaxHgt=1000000;
} }
// #119885# Do not limit/force height to geometrical frame (vice versa for vertical writing)
if(IsVerticalWriting())
{
nMaxWdt = 1000000;
}
else
{
nMaxHgt = 1000000;
}
aPaperMax.Width()=nMaxWdt; aPaperMax.Width()=nMaxWdt;
aPaperMax.Height()=nMaxHgt; aPaperMax.Height()=nMaxHgt;
} else { }
else
{
aPaperMax=aMaxSiz; aPaperMax=aMaxSiz;
} }
aPaperMin.Width()=nMinWdt; aPaperMin.Width()=nMinWdt;
......
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